Implement custom logging email backend for development: log outgoing emails to Loguru and stdout

This commit is contained in:
Ross
2025-12-15 13:14:12 +00:00
parent 03b23b9178
commit c071f38920
4 changed files with 17 additions and 3 deletions
+5 -1
View File
@@ -43,7 +43,11 @@ DEBUG_TOOLBAR_CONFIG = {
# deployment README. Adjust as needed.
STATIC_ROOT = '/usr/src/app/static/'
EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
import os
# Allow environment to override the email backend (so dev .env can select
# a file-based backend while production keeps SMTP).
EMAIL_BACKEND = os.environ.get("EMAIL_BACKEND", "django.core.mail.backends.smtp.EmailBackend")
if not DEBUG:
LOGGING = {