Discussion:
Fascinating Problem
Matthew Pava
2018-11-16 20:52:12 UTC
Permalink
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.
--
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/2ac5947cc43a45c3a6b71bf773fa640f%40iss2.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.
Ryan Nowakowski
2018-11-18 15:20:47 UTC
Permalink
Posting the view code might be helpful for folks to help you debug.
Post by Matthew Pava
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.
--
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
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/2ac5947cc43a45c3a6b71bf773fa640f%40iss2.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.
--
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
2018-11-19 19:04:23 UTC
Permalink
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.

From: django-***@googlegroups.com [mailto:django-***@googlegroups.com] On Behalf Of Ryan Nowakowski
Sent: Sunday, November 18, 2018 9:21 AM
To: django-***@googlegroups.com
Subject: Re: Fascinating Problem

Posting the view code might be helpful for folks to help you debug.
On November 16, 2018 2:52:12 PM CST, Matthew Pava <***@iss.com> wrote:
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.
--
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<mailto:django-users+***@googlegroups.com>.
To post to this group, send email to django-***@googlegroups.com<mailto: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<https://groups.google.com/d/msgid/django-users/44E3122D-F6A8-466F-AF50-D1386191747A%40fattuba.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
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/46b1cafcc0224160b3efbde9e14f1726%40iss2.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.
Matthew Pava
2018-11-19 20:34:44 UTC
Permalink
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)


From: django-***@googlegroups.com [mailto:django-***@googlegroups.com] On Behalf Of Matthew Pava
Sent: Monday, November 19, 2018 1:04 PM
To: django-***@googlegroups.com
Subject: RE: Fascinating Problem

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.

From: django-***@googlegroups.com [mailto:django-***@googlegroups.com] On Behalf Of Ryan Nowakowski
Sent: Sunday, November 18, 2018 9:21 AM
To: django-***@googlegroups.com
Subject: Re: Fascinating Problem

Posting the view code might be helpful for folks to help you debug.
On November 16, 2018 2:52:12 PM CST, Matthew Pava <***@iss.com> wrote:
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.
--
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<mailto:django-users+***@googlegroups.com>.
To post to this group, send email to django-***@googlegroups.com<mailto: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<https://groups.google.com/d/msgid/django-users/44E3122D-F6A8-466F-AF50-D1386191747A%40fattuba.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
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<mailto:django-users+***@googlegroups.com>.
To post to this group, send email to django-***@googlegroups.com<mailto: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/46b1cafcc0224160b3efbde9e14f1726%40iss2.ISS.LOCAL<https://groups.google.com/d/msgid/django-users/46b1cafcc0224160b3efbde9e14f1726%40iss2.ISS.LOCAL?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
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/dfc0f32b8cfc439db462ce0677a3646f%40iss2.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Loading...