I am trying to learn django, and I have a small test server (not devel) to this effect where I am trying to host a small blog site (similar to the official tutorial).
I'd like to have custom 404 and 500 views, so, I have the following in urls.py
:
from mystuff.views import Template404View, Template500View
handler404 = Template404View.as_view()
handler500 = Template500View.as_view()
and in my views.py
, I have the following:
class Template404View(TemplateView):
template_name = "404.html"
class Template500View(TemplateView):
template_name = "500.html"
where, the 404.html
and 500.html
are present in my site_templates
directory.
However, when I host this on my test server, instead of seeing 400 or 500 custom pages, all I see is Internal Server Error
.
I have tried to look up similar questions on SO, and I see the following, but this does not seem to help...
Any advice would be appreciated...Thanks.