Skip to content

Commit

Permalink
Add DEBUG_DB and DEBUG_MAIL
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSuncatcher222 committed Nov 26, 2023
1 parent 27717ab commit 4dacab6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
11 changes: 11 additions & 0 deletions backend/urban_utopia_2024/app_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@
else:
DEBUG: bool = False

DEBUG_DB = os.getenv('DEBUG_DB')
if DEBUG_DB == 'True':
DEBUG_DB: bool = True
else:
DEBUG_DB: bool = False

DEBUG_MAIL = os.getenv('DEBUG')
if DEBUG_MAIL == 'True':
DEBUG_MAIL: bool = True
else:
DEBUG_MAIL: bool = False

"""Django data."""

Expand Down
6 changes: 3 additions & 3 deletions backend/urban_utopia_2024/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from urban_utopia_2024.app_data import (
AUTH_TOKEN, AUTH_JWT,
BASE_DIR, DEBUG,
BASE_DIR, DEBUG, DEBUG_DB, DEBUG_MAIL,
DATABASE_SQLITE, DATABASE_POSTGRESQL,
DEFAULT_FROM_EMAIL,
EMAIL_HOST, EMAIL_PORT, EMAIL_HOST_USER, EMAIL_HOST_PASSWORD,
Expand Down Expand Up @@ -44,7 +44,7 @@
"""Django settings."""


DATABASES = DATABASE_SQLITE if DEBUG else DATABASE_POSTGRESQL
DATABASES = DATABASE_SQLITE if DEBUG_DB else DATABASE_POSTGRESQL

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

Expand Down Expand Up @@ -117,7 +117,7 @@

DEFAULT_FROM_EMAIL = DEFAULT_FROM_EMAIL

if DEBUG:
if DEBUG_MAIL:
EMAIL_FILE_PATH = os.path.join(BASE_DIR, 'sent_emails')
EMAIL_BACKEND = 'django.core.mail.backends.filebased.EmailBackend'
else:
Expand Down

0 comments on commit 4dacab6

Please sign in to comment.