Bug in Django? It throws server error when context processor raises Http404

68 views
Skip to first unread message

Alexey Grigoriev

unread,
Jun 9, 2015, 7:22:44 AM6/9/15
to django...@googlegroups.com
Django doesn't catch django.http.Http404 exception in my context processor when Debug=False and when I have custom '404.html' template. It just throws Internal Server Error. Is it Django bug?

Galia Ladiray

unread,
Jun 9, 2015, 9:10:24 AM6/9/15
to django...@googlegroups.com
Maybe it does not find your custom 404.html (and gives you a 500 of not finding it)?
Try to use this template elsewhere with debug=True, just to see ....

Kapil Mangtani

unread,
Jun 9, 2015, 10:44:49 AM6/9/15
to django...@googlegroups.com
have you written the handler correctly?

Alexey Grigoriev

unread,
Jun 9, 2015, 12:54:33 PM6/9/15
to django...@googlegroups.com
I found this issue in my big project. And then I started new Django project from scratch, and reproduced the problem. 
You can reproduce this bug: 
1) start new Django project
2) create context processor that raises Http404 
3) set Debug=False 
4) create custom '404.html' template
And then you get Server Error Page, instead of 404 page

Erik Cederstrand

unread,
Jun 9, 2015, 3:13:43 PM6/9/15
to Django Users
Please create a bug report and attach the code for your test project. That way, it's easier for everyone to reproduce.

Erik

Reply all
Reply to author
Forward
0 new messages