According to the documentation, if
DEBUG is set to
False and something is provided under the
ADMINS setting, Django will send an email whenever the code raises a 500 status code. I have the email settings filled out properly (as I can use send_mail fine) but whenever I intentionally put up erroneous code I get my 500.html template but no error email is sent. What could cause Django to not do this?
In my case the cause was missing SERVER_EMAIL setting.
The default for
root@localhost. But many of email servers including
my email provider do not accept emails from such suspicious addresses. They silently drop the emails.
Changing the sender email address to
email@example.com solved the problem. In
SERVER_EMAIL = 'firstname.lastname@example.org'