Django emailing on errors

前端 未结 1 660
栀梦
栀梦 2021-01-20 04:19

I have been struggling to get the emailing to work in Django for logging as well as for 500 and 404 errors and for the life of me I cant get it to work. I have DEBUG=F

相关标签:
1条回答
  • 2021-01-20 05:16

    Yep, it's not ADMINS = () that receives SEND_BROKEN_LINK_EMAILS, it's MANAGERS = ()

    https://docs.djangoproject.com/en/dev/ref/settings/#managers

    https://docs.djangoproject.com/en/dev/howto/error-reporting/#errors

    Add this right under ADMINS and it should work:

    MANAGERS = ADMINS
    

    You may also want to specify EMAIL_BACKEND in settings, e.g. assuming SMTP:

    EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
    

    https://docs.djangoproject.com/en/dev/ref/settings/#email-backend

    0 讨论(0)
提交回复
热议问题