From c6aa72e843607621da88da9526bd457d9b097a56 Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Tue, 9 Jul 2024 10:15:35 +0200 Subject: [PATCH] feat(settings): Add more email configuration --- app/settings.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/settings.py b/app/settings.py index 39f82ca..3e8ce17 100644 --- a/app/settings.py +++ b/app/settings.py @@ -96,13 +96,12 @@ WSGI_APPLICATION = "app.wsgi.application" # E-Mail configuration DEFAULT_FROM_EMAIL = credentials["FROM_EMAIL"] -EMAIL_HOST = credentials["EMAIL_HOST"] +EMAIL_HOST = credentials.get("EMAIL_HOST", "localhost") +EMAIL_HOST_PASSWORD = credentials.get("EMAIL_HOST_PASSWORD", "") +EMAIL_HOST_USER = credentials.get("EMAIL_HOST_USER", "") +EMAIL_USE_SSL = credentials.get("EMAIL_USE_SSL", False) SERVER_EMAIL = credentials["SERVER_EMAIL"] -if DEBUG: - # Otherwise, use the default smtp backend - EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend" - ### # Default primary key field type @@ -193,6 +192,9 @@ BACKGROUND_TASK_ASYNC_THREADS = 4 if DEBUG: + # Print the e-mails in the console + EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend" + INSTALLED_APPS += [ "debug_toolbar", "django_browser_reload",