Changeset - 60d3d040d200
[Not reviewed]
0 1 0
Brett Smith - 4 years ago 2018-10-10 17:36:21
brettcsmith@brettcsmith.org
settings: Make EMAIL_BACKEND more flexible.
1 file changed with 5 insertions and 2 deletions:
0 comments (0 inline, 0 general)
pinaxcon/settings.py
Show inline comments
...
 
@@ -246,14 +246,17 @@ COMPRESS_PRECOMPILERS = (
 
FIXTURE_DIRS = [
 
    os.path.join(PROJECT_ROOT, "fixtures"),
 
]
 

	
 
# Heroku: Get email configuration from environment variables.
 

	
 
EMAIL_BACKEND = "email_log.backends.EmailBackend"
 
EMAIL_LOG_BACKEND = os.environ.get("DJANGO_EMAIL_BACKEND", "django.core.mail.backends.console.EmailBackend")  # noqa
 
EMAIL_BACKEND = os.environ.get(
 
    "DJANGO_EMAIL_BACKEND",
 
    "django.core.mail.backends.{}.EmailBackend".format('console' if DEBUG else 'smtp'),
 
)
 
EMAIL_LOG_BACKEND = "email_log.backends.EmailBackend"
 
EMAIL_HOST = os.environ.get("DJANGO_EMAIL_HOST", "")
 
EMAIL_PORT = int(os.environ.get("DJANGO_EMAIL_PORT", 25))
 
EMAIL_HOST_USER = os.environ.get("DJANGO_EMAIL_HOST_USER", "")
 
EMAIL_HOST_PASSWORD = os.environ.get("DJANGO_EMAIL_HOST_PASSWORD", "")
 
EMAIL_USE_TLS = bool(int(os.environ.get("DJANGO_EMAIL_USE_TLS", "0")))
 
EMAIL_USE_SSL = bool(int(os.environ.get("DJANGO_EMAIL_USE_SSL", "0")))
0 comments (0 inline, 0 general)