-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
986de4d
commit f2611bd
Showing
8 changed files
with
74 additions
and
28 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
USER= | ||
PASSWORD= | ||
HOST= | ||
PORT= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Generated by Django 4.2.10 on 2024-03-04 02:00 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
('games', '0020_alter_game_author'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='game', | ||
name='author', | ||
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='games', to=settings.AUTH_USER_MODEL), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
SECRET_KEY = 'django-insecure-%d4lk*zmbliye-#1vjv8$v=*y8&yiq1u9d@e=u(k$hl+7a8djx' | ||
|
||
# SECURITY WARNING: don't run with debug turned on in production! | ||
DEBUG = False | ||
DEBUG = True | ||
|
||
ALLOWED_HOSTS = ['*'] | ||
|
||
|
@@ -62,16 +62,31 @@ | |
|
||
WSGI_APPLICATION = 'harkerbyte.wsgi.application' | ||
|
||
|
||
# Database | ||
# https://docs.djangoproject.com/en/4.2/ref/settings/#databases | ||
|
||
DATABASES = { | ||
'default': { | ||
'ENGINE': 'django.db.backends.sqlite3', | ||
'NAME': BASE_DIR / 'db.sqlite3', | ||
#READY FOR PRODUCTION? - True / False | ||
PRODUCTION = False | ||
|
||
if PRODUCTION==True: | ||
#THIS CONDITION USES POSTGRESQL ON DEFAULT | ||
dbpath = os.path.join(BASE_DIR, '.credentials/db.config') | ||
configdb = Config(RepositoryEnv(dbpath)) | ||
DATABASES = { | ||
'default': { | ||
'ENGINE': 'django.db.backends.postgresql', | ||
'NAME': 'postgres', | ||
'USER':configdb.get('USER'), | ||
'PASSWORD':configdb.get('PASSWORD'), | ||
'HOST':configdb.get('HOST'), | ||
'PORT':configdb.get('PORT') | ||
} | ||
} | ||
|
||
else: | ||
DATABASES = { | ||
'default': { | ||
'ENGINE':'django.db.backends.sqlite3', | ||
'NAME': BASE_DIR / 'db.sqlite3' | ||
} | ||
} | ||
} | ||
|
||
|
||
# Password validation | ||
|
@@ -120,8 +135,8 @@ | |
DEVELOPER = ['[email protected]'] | ||
|
||
|
||
if DEBUG==False: | ||
path = os.path.join(BASE_DIR, '.env') | ||
if PRODUCTION==True: | ||
path = os.path.join(BASE_DIR, '.credentials/.env') | ||
config = Config(RepositoryEnv(path)) | ||
AWS_ACCESS_KEY_ID=config.get('AWS_ACCESS_KEY_ID') | ||
AWS_SECRET_ACCESS_KEY=config.get('AWS_SECRET_ACCESS_KEY') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters