ADMINS = [("alex", "alex@mydomain.com"), ("matt", "matt@mydomain.com")]
DEBUG = False
Django为什么不通过电子邮件向我发送错误?我正确设置了电子邮件设置,其他所有东西都可以发送电子邮件了.
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"
我想通过电子邮件收到所有发生的错误. (即使我到处都有自己的try / except块).
解决方法:
从django文档上的error-reporting:
By default, Django will send e-mail
from root@localhost. However, some
mail providers reject all e-mail from
this address. To use a different
sender address, modify the
SERVER_EMAIL setting.
也许这会对您有所帮助.