Opened 9 years ago
Last modified 9 years ago
#25045 closed Bug
Django 1.8.2 handler404 and handler500 no longer work — at Initial Version
Reported by: | simon9999 | Owned by: | nobody |
---|---|---|---|
Component: | Core (Other) | Version: | 1.8 |
Severity: | Normal | Keywords: | handler404 |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I've been testing with DEBUG=False under 'python manage.py runserver'.
As per the dox, I have added into my ROOT url file, the required overrides:
from django.conf.urls import * from django.contrib import admin from django.http import HttpResponse handler404 = 'urls.custom_handler' handler500 = 'urls.custom_handler' urlpatterns = [ url(r'^apikey/', include('apikey.urls', namespace='apikey')), url(r'^admin/', include(admin.site.urls)), ] def custom_handler(request): print '---->>>> got to here!' raise Exception return HttpResponse('<h1>Boo! - Page not found</h1>')
I have created both the default 404.html and 500.html templates in my apikey/templates directory and updated the site settings file to reflect this
and I can confirm that this default 404.html and 500.html files are indeed getting rendered, but not by my routine.
My custom handler never, ever fires when a 404 or 500 is raised.
I am at a loss as to why this has stopped working and I have been searching both the tickets DB and the net for a solution so it may well be a bug.