I configured Error Reporting for my django app so it will send an report by email to those who i specified in ADMINS
list in settings.py
(see this). it works perfectly well.
Based on official django documentation, it will trigger whenever a HTTP 500 or greater
status code raised:
When DEBUG is False, Django will email the users listed in the ADMINS
setting whenever your code raises an unhandled exception and results
in an internal server error (strictly speaking, for any response with
an HTTP status code of 500 or greater).
How to override this behavior?
To be specific, i want receive emails just when HTTP 500
raised.
More Details:
Sometimes i enable maintenance mode in my app, so each request will responded by a HTTP 503
code, and since 503 > 500
, django sends me an email for each request! i wanna somehow override this behavior.