Why doesn't Django email me errors when my DEBUG = False?

ADMINS = [("alex", "alex@mydomain.com"), ("matt", "matt@mydomain.com")]

DEBUG = False

Why doesn't Django email me errors? I set up the email settings correctly and everything else can send emails just fine.

EMAIL_HOST = "mail.blah.com"
EMAIL_PORT = 25
EMAIL_HOST_USER = "blah"
EMAIL_HOST_PASSWORD = "blah"
EMAIL_USE_TLS = True
DEFAULT_FROM_EMAIL = "blah@blah.com"

I want to email all errors that occurred. (although I have my own try / except blocks everywhere).

+3
source share
2 answers

From django documentation on error-reporting :

By default, Django will send an email from root @localhost. However, some mail providers reject all emails from this address. Use a different sender address, change SERVER_EMAIL.

Perhaps this will help you.

+3

, , django, - , ( ) . , django ( ). , , ... , .

settings.py

EMAIL_HOST = "localhost"
EMAIL_PORT = 1025

, -

python -m smtpd -n -c DebuggingServer localhost:1025

Django: http://docs.djangoproject.com/en/dev/topics/email/

+2

Source: https://habr.com/ru/post/1788715/


All Articles