Fascinating Problem

28 views
Skip to first unread message

Matthew Pava

unread,
Nov 16, 2018, 3:52:53 PM11/16/18
to django...@googlegroups.com

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.

Ryan Nowakowski

unread,
Nov 18, 2018, 10:21:25 AM11/18/18
to django...@googlegroups.com
Posting the view code might be helpful for folks to help you debug.

Matthew Pava

unread,
Nov 19, 2018, 2:05:43 PM11/19/18
to django...@googlegroups.com

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.

Matthew Pava

unread,
Nov 19, 2018, 3:35:33 PM11/19/18
to django...@googlegroups.com

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)
Reply all
Reply to author
Forward
0 new messages