Skip to content

Commit

Permalink
Merge pull request #116 from SADiLaR/more-mail-settings
Browse files Browse the repository at this point in the history
Obtain more email settings from environment
  • Loading branch information
friedelwolff authored Aug 21, 2024
2 parents 56a503e + a74a486 commit e36730e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
7 changes: 4 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ LOGGING_HANDLERS_LEVEL=INFO
LOGGING_LOGGERS_LEVEL=INFO
LOGGING_LOGGERS_DJANGO_LEVEL=INFO
TESTING_DIR=/app/general/tests/files/
FEATURE_FLAG=''
EMAIL_HOST=''
EMAIL_USE_TLS=True
EMAIL_PORT=587
EMAIL_USE_TLS=True
EMAIL_HOST_USER=''
EMAIL_HOST_PASSWORD=''
DEFAULT_FROM_EMAIL=''
SERVER_EMAIL=''
EMAIL_SUBJECT_PREFIX=''
EMAIL_BACKEND_CONSOLE='True/False'
EMAIL_USE_TLS=True
SECRET_KEY=''
1 change: 0 additions & 1 deletion .env.testing
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ LOGGING_HANDLERS_LEVEL=INFO
LOGGING_LOGGERS_LEVEL=INFO
LOGGING_LOGGERS_DJANGO_LEVEL=INFO
TESTING_DIR=/home/runner/work/term_platform/term_platform/app/general/tests/files/
FEATURE_FLAG=''
14 changes: 9 additions & 5 deletions app/app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,15 @@ def __contains__(self, address):


# Email settings
EMAIL_HOST = os.environ.get("EMAIL_HOST")
EMAIL_HOST_USER = os.environ.get("EMAIL_HOST_USER")
EMAIL_HOST_PASSWORD = os.environ.get("EMAIL_HOST_PASSWORD")
EMAIL_PORT = os.environ.get("EMAIL_PORT")
EMAIL_USE_TLS = os.environ.get("EMAIL_USE_TLS")
EMAIL_HOST = os.environ.get("EMAIL_HOST", "localhost")
EMAIL_PORT = os.environ.get("EMAIL_PORT", 25)
EMAIL_USE_TLS = os.environ.get("EMAIL_USE_TLS", False)
EMAIL_HOST_USER = os.environ.get("EMAIL_HOST_USER", "")
EMAIL_HOST_PASSWORD = os.environ.get("EMAIL_HOST_PASSWORD", "")
DEFAULT_FROM_EMAIL = os.environ.get("DEFAULT_FROM_EMAIL", "webmaster@localhost")
SERVER_EMAIL = os.environ.get("SERVER_EMAIL", "root@localhost")
EMAIL_SUBJECT_PREFIX = os.environ.get("EMAIL_SUBJECT_PREFIX", "[Django] ")
ADMINS = os.environ.get("ADMINS", "").split()

email_backend_env = os.environ.get("EMAIL_BACKEND_CONSOLE", "False").lower() in ["true", "1", "yes"]

Expand Down

0 comments on commit e36730e

Please sign in to comment.