From a3b2e4657678228539f475996d4cf915f55b4ebc Mon Sep 17 00:00:00 2001 From: Peter Makholm Date: Thu, 25 Jul 2024 12:06:41 +0000 Subject: [PATCH] Support logging emails to console in debug mode --- boofilsic/settings.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/boofilsic/settings.py b/boofilsic/settings.py index e4ddd173..233efbd5 100644 --- a/boofilsic/settings.py +++ b/boofilsic/settings.py @@ -180,6 +180,9 @@ EMAIL_BACKEND = _parsed_email_url.hostname ANYMAIL = dict(parse.parse_qsl(_parsed_email_url.query)) ENABLE_LOGIN_EMAIL = True +elif DEBUG and _parsed_email_url.scheme == "console": + EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend" + ENABLE_LOGIN_EMAIL = True elif _parsed_email_url.scheme: _parsed_email_config = env.email("NEODB_EMAIL_URL") EMAIL_TIMEOUT = 5