Skip to content

Commit

Permalink
Update default settings to correctly pass smtp credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Rusakov authored and lanseg committed Feb 5, 2025
1 parent 8819154 commit cce1aaa
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions default_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,18 @@
GEOS_LIBRARY_PATH = 'C:/OSGeo4W/bin/geos_c'

ALLOWED_HOSTS = os.environ["ALLOWED_HOST"].split(",")
hostport = os.environ.get('EMAIL_HOST', 'localhost:1025').split(":")
EMAIL_HOST = hostport[0]
EMAIL_PORT = hostport[1] if len(hostport) == 2 else os.environ.get('EMAIL_PORT', 1025)
# Setting to test email sending in console
EMAIL_BACKEND = os.environ.get('EMAIL_BACKEND', 'django.core.mail.backends.console.EmailBackend')

#
DEFAULT_FROM_EMAIL = os.environ.get('DEFAULT_FROM_EMAIL', '[email protected]')
ADMIN_EMAIL_LIST = os.environ.get('ADMIN_EMAIL_LIST', '[email protected]')
REPLY_TO_EMAIL = os.environ.get('REPLY_TO_EMAIL', '[email protected]')

EMAIL_HOST = os.environ.get('EMAIL_HOST', 'localhost')
EMAIL_PORT = os.environ.get('EMAIL_PORT', 1025)
EMAIL_HOST_USER = os.environ.get('EMAIL_HOST_USER')
EMAIL_HOST_PASSWORD = os.environ.get('EMAIL_HOST_PASSWORD')
EMAIL_USE_TLS=True
EMAIL_BACKEND = os.environ.get('EMAIL_BACKEND', 'django.core.mail.backends.console.EmailBackend')

# Application definition

INSTALLED_APPS = [
Expand Down

0 comments on commit cce1aaa

Please sign in to comment.