I have come across an interesting issue with my error handling. Whenever I go to a URL that throws an exception (I have one for testing) as one of the ADMINS when DEBUG is False, I get the 500 error, and the email from the server indicating it. When a different user navigates to the URL, the development server returns a 200, but it renders the 500 error message page, and I get no email message. I have tried restoring all email and logging settings to their Django defaults, but I continue to get this issue. If you have any ideas, I’m quite interested.
Okay, I’ve managed to deduce that I’m able to get an email when Debug is True. When Debug is False, I do not get the email.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
django-users...@googlegroups.com.
To post to this group, send email to
django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/44E3122D-F6A8-466F-AF50-D1386191747A%40fattuba.com.
For more options, visit https://groups.google.com/d/optout.
I have resolved the issue. I have a custom 500 view that just renders a template. The render call never specified that status code. Amazingly, it worked in the past. I have specified the status code in the function, and now the emails are coming through.
So previously, I had this:
def my_500(request,
*args,
**kwargs):
return
render(request,
"errors/500.html")
Now, I have this, and it works:
def my_500(request, *args, **kwargs):
return render(request, "errors/500.html", status=500)
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/46b1cafcc0224160b3efbde9e14f1726%40iss2.ISS.LOCAL.