Django 1.4.1 Bug Report Does Not Send Me An Email

This question is probably a duplicate question and regrets it.

I am using Django 1.4.1 , and on the production server I set DEBUG to False . Sometimes users get an exception and the server shows the 500.html template, but does not send the email configured in the ADMINS settings.py section.

The application sending the email is configured correctly, because during the registration process I can receive a welcome email.

A snippet of my settings.py :

 DEBUG = False TEMPLATE_DEBUG = DEBUG ADMINS = ( ('example', ' example@example.com '), # this changed but my email is correct ) MANAGERS = ADMINS MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware', 'django.middleware.transaction.TransactionMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ) LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'filters': { 'require_debug_false': { '()': 'django.utils.log.RequireDebugFalse' } }, 'handlers': { 'mail_admins': { 'level': 'ERROR', 'filters': ['require_debug_false'], 'class': 'django.utils.log.AdminEmailHandler' } }, 'loggers': { 'django.request': { 'handlers': ['mail_admins'], 'level': 'ERROR', 'propagate': True, }, } } 
+6
source share
2 answers

You set SERVER_EMAIL in the settings. This is from the address used to send error messages. By default, root @localhost, which can be blocked on SMTP. You may need to set it the same as DEFAULT_FROM_EMAIL

+8
source

It already embarrassed me a little. JUST figured this out:

 ADMINS = ( ('Your Name', ' your_email@example.com '), ***** ) 

That comma at the end was all that I forgot, and that was enough to break it. Thought I would share it so that some other poor idiot like me could save his precious hair that he could pull out ...

+10
source

All Articles