[Solved]-Django error email report not being sent

19πŸ‘

βœ…

it seems that your problem is in your logging configuration: in settings.py LOGGING:

 'handlers': {
    'mail_admins': {
        'level': 'ERROR',
        'filters': ['require_debug_false'],
        'class': 'django.utils.log.AdminEmailHandler'
    },
 }

This config indicate that mail_admins handler work only in DEBUG = False because the filter used.
If you try with mode debug false or you can activate this handler in debug mode just comment the filters:

 'handlers': {
    'mail_admins': {
        'level': 'ERROR',
        #'filters': ['require_debug_false'],
        'class': 'django.utils.log.AdminEmailHandler'
    },
 }

Edit:

Your configuration doesn’t call mail_admins handler. Add it to the django logger like this:

'loggers': {
    'django': {
        'handlers': ['file', 'console', 'mail_admins',],
        'propagate': True,
        'level': 'DEBUG',
    },
πŸ‘€Mounir

Leave a comment