i noticed about to change the subject for django error reporting emails, is it possible to change subject? can we modify the subject for Django error reporting emails ?
You need to set the EMAIL_SUBJECT_PREFIX
variable in your Django settings file.
https://docs.djangoproject.com/en/1.8/ref/settings/#email-subject-prefix
EMAIL_SUBJECT_PREFIX
Default:
'[Django] '
Subject-line prefix for email messages sent with
django.core.mail.mail_admins
ordjango.core.mail.mail_managers
. You’ll probably want to include the trailing space.
If you don't like Django error emails and want a better way of handling them, take a look a Sentry.
If you need it only for reporting errors the best choice would be to inherit from the django.utils.log.AdminEmailHandler
and override the def format_subject(self, subject):
method.
Note that changing EMAIL_SUBJECT_PREFIX
will affect not only error emails but all emails send to admins including system information emails or so.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With