Why am I getting multiple django error report emails for every exception?

7 views
Skip to first unread message

Tal

unread,
Jul 19, 2019, 4:23:49 PM7/19/19
to Django users

I setup my django 2.2.3 project to use gmail to send emails out.

I also have it configured to send me emails about any exceptions that occur.

To test it, I made a view with:

float('a')

It works, but I'm getting 2 emails in my Gmail inbox every time I hit that view:

Screen Shot 2019-07-19 at 10.10.53 AM.png


The first email above seems to be related to the fact that after django hit my float('a') line, an HTTP 500 exception was thrown. One of the lines in it reads "Request data not supplied", if that helps.

The second email above actually has the traceback from the float('a') exception. It does have request data supplied (GET parameters, POST parameters, COOKIES, FILES, etc).

Is this normal? Is the email about the HTTP 500 exception ever useful? It seems like it would always be accompanied by another email with more detail about why the HTTP 500 error occurred, making it pretty useless. If so, is there a way to disable it? Or am I doing something wrong?

PS. I started a different topic about why the first email has characters like [35;1m in it, which seems unrelated.

Tal

unread,
Jul 19, 2019, 8:12:33 PM7/19/19
to Django users
After a bit of digging, it turns out that if I disable the django-channels app that I'm using, I only get the one email with the exception that was thrown.
Even if I don't disable the django-channels app, and run it with daphne (as I would in production), rather than using the django channels ASGI development server, it works fine, and I only get one email when an exception is thrown.
Reply all
Reply to author
Forward
0 new messages