From 79f8903c2c9cde27967593749331dfc4ce28a319 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=AD=C3=B0ir=20Valberg=20Gu=C3=B0mundsson?= Date: Wed, 3 Mar 2021 14:58:46 +0100 Subject: [PATCH] Add email configuration. --- src/project/settings.py | 11 ++++++++++- src/project/templates/account/login.html | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/project/settings.py b/src/project/settings.py index 281a246..40383e8 100644 --- a/src/project/settings.py +++ b/src/project/settings.py @@ -103,7 +103,16 @@ SITE_ID = 1 LOGIN_REDIRECT_URL = "/" -EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend" +EMAIL_BACKEND = env.str( + "EMAIL_BACKEND", default="django.core.mail.backends.console.EmailBackend" +) +# Parse email URLs, e.g. "smtp://" +email = env.dj_email_url("EMAIL_URL", default="smtp://") +EMAIL_HOST = email["EMAIL_HOST"] +EMAIL_PORT = email["EMAIL_PORT"] +EMAIL_HOST_PASSWORD = email["EMAIL_HOST_PASSWORD"] +EMAIL_HOST_USER = email["EMAIL_HOST_USER"] +EMAIL_USE_TLS = email["EMAIL_USE_TLS"] # Always show DDT in development for any IP, not just 127.0.0.1 or # settings.INTERNAL_IPS. This is useful in a docker setup where the diff --git a/src/project/templates/account/login.html b/src/project/templates/account/login.html index d17b786..0c36f83 100644 --- a/src/project/templates/account/login.html +++ b/src/project/templates/account/login.html @@ -17,7 +17,7 @@