From 7cd2fd2b75bc5597e9b2a128bf61201910be6df2 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Wed, 4 Dec 2024 17:11:55 +0000 Subject: Email verification - Associated changes in the .env file now allow us to test the SMTP server config - Added mine and J's email ad admins - Grab env variables from the .env file in the local.py file for testing purposes - Set an expiry of 24hrs for the validation link to work - Added an HTML version of the verification email --- config/settings/local.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'config/settings/local.py') diff --git a/config/settings/local.py b/config/settings/local.py index 155b219..0e4b7e4 100644 --- a/config/settings/local.py +++ b/config/settings/local.py @@ -29,9 +29,20 @@ CACHES = { # EMAIL # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#email-host -EMAIL_HOST = env("EMAIL_HOST", default="mailpit") +# EMAIL_HOST = env("EMAIL_HOST", default="mailpit") # https://docs.djangoproject.com/en/dev/ref/settings/#email-port -EMAIL_PORT = 1025 +# EMAIL_PORT = 1025 + +DEFAULT_FROM_EMAIL = env( + "DJANGO_DEFAULT_FROM_EMAIL", + default="alphabetlearning.online ", +) +SERVER_EMAIL = env("DJANGO_SERVER_EMAIL", default=DEFAULT_FROM_EMAIL) +EMAIL_HOST = env('EMAIL_HOST') +EMAIL_PORT = env('EMAIL_PORT') +EMAIL_HOST_USER = env('EMAIL_HOST_USER') +EMAIL_HOST_PASSWORD = env('EMAIL_HOST_PASSWORD') +EMAIL_USE_TLS = env.bool('EMAIL_USE_TLS', default=True) # WhiteNoise # ------------------------------------------------------------------------------ -- cgit v1.2.3