[PATCH 2/3] settings: Also define SERVER_EMAIL for email logs

Damien Lespiau damien.lespiau at intel.com
Sun Sep 27 00:06:27 AEST 2015


Django can send emails to admins on 500 HTTP errors when DEBUG is false.
That looks handy. That mechanism uses SERVER_EMAIL for the From:
address, which defaults to root at localhost and can cause problems in the
email delivery.

Use the same address than DEFAULT_FROM_EMAIL by default.

Signed-off-by: Damien Lespiau <damien.lespiau at intel.com>
---
 patchwork/settings/base.py               | 1 +
 patchwork/settings/production.example.py | 1 +
 2 files changed, 2 insertions(+)

diff --git a/patchwork/settings/base.py b/patchwork/settings/base.py
index d47cd6d..fd99b71 100644
--- a/patchwork/settings/base.py
+++ b/patchwork/settings/base.py
@@ -67,6 +67,7 @@ TEMPLATE_DIRS = (
 # email
 
 DEFAULT_FROM_EMAIL = 'Patchwork <patchwork at patchwork.example.com>'
+SERVER_EMAIL = DEFAULT_FROM_EMAIL
 
 #
 # Auth settings
diff --git a/patchwork/settings/production.example.py b/patchwork/settings/production.example.py
index 7af79a7..9cf6712 100644
--- a/patchwork/settings/production.example.py
+++ b/patchwork/settings/production.example.py
@@ -34,6 +34,7 @@ ADMINS = (
 )
 
 DEFAULT_FROM_EMAIL = 'Patchwork <patchwork at patchwork.example.com>'
+SERVER_EMAIL = DEFAULT_FROM_EMAIL
 NOTIFICATION_FROM_EMAIL = DEFAULT_FROM_EMAIL
 
 # Database
-- 
2.1.0



More information about the Patchwork mailing list