Error or stack trace redirection in Django

19 views
Skip to first unread message

Ram

unread,
Jul 13, 2020, 2:09:56 AM7/13/20
to django...@googlegroups.com
Hi,

When a failure is happened in Django web application, we noticed that the error is returned directly on the web browser as shown in the attached snap. We wanted to understand whether this is expected as per Django FWK or are we doing something wrong in our coding itself?  I believe we should never display anything other than error message that is explicity provided in coding statement, e.g. "Invalid login Id".

If coding needs to be changed here to avoid stack trace on the user browsers, what should be changed here?

Thanks,
~Ram
Screen Shot 2020-07-12 at 7.53.51 PM.png

Christophe Pettus

unread,
Jul 13, 2020, 2:18:41 AM7/13/20
to django...@googlegroups.com


> On Jul 12, 2020, at 19:08, Ram <ram.mu...@gmail.com> wrote:
>
> If coding needs to be changed here to avoid stack trace on the user browsers, what should be changed here?

You have DEBUG = True; that will result in the debugging output you see. You shouldn't ever have it turned on for a production website.

--
-- Christophe Pettus
x...@thebuild.com

Ram

unread,
Jul 13, 2020, 2:31:59 AM7/13/20
to django...@googlegroups.com
Yes, this error is from our development server and we have DEBUG = True.  Thanks for quick answer. We will not turn this on in production server.

Best regards,
~Ram

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/0BCA3B5B-7C4E-4D94-89DE-7B94A5C4B201%40thebuild.com.
Reply all
Reply to author
Forward
0 new messages