Opened 16 years ago
Closed 12 years ago
#10934 closed Uncategorized (worksforme)
handler404 needs an example
Reported by: | Maarten Nieber | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | 1.0 |
Severity: | Normal | Keywords: | handler404 |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Hi,
I'm doing the tutorial and tried to set up my own 404 handler, following the hints in the tutorial.
However, here the tutorial is not clear:
- where exactly does Django look for the handler404 name?
- should I assign a new object to django.conf.urls.defaults.handler404, or create the name handler404 inside the views module?
- I did not create a 404.html, how come Django does not complain about that? (quote: The default 404 view will use that template for all 404 errors.)
An example of setting up your own 404 handler would help a lot (I still have not managed, so now it feels like I missed a point somewhere).
By the way, the tutorial is excellent in all other aspects!
Change History (5)
comment:1 by , 16 years ago
Component: | Uncategorized → Documentation |
---|
comment:2 by , 15 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:3 by , 15 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
comment:4 by , 12 years ago
Easy pickings: | unset |
---|---|
Resolution: | worksforme |
Severity: | → Normal |
Status: | closed → reopened |
Type: | → Uncategorized |
UI/UX: | unset |
Version: | 1.0 → 1.4-rc-1 |
comment:5 by , 12 years ago
Resolution: | → worksforme |
---|---|
Status: | reopened → closed |
Version: | 1.4-rc-1 → 1.0 |
Note:
See TracTickets
for help on using tickets.
Replying to mnieber:
According to the third paragraph of http://docs.djangoproject.com/en/dev/topics/http/views/#the-404-page-not-found-view the 404 doc, Django looks in your
urls.py
.This is also addressed in that same paragraph. You just define a variable
handler404
and you're set.AFAIK, django doesn't provide a default
404.html
. If you didn't create one, you should get a 'template not found' error - that is, if you trigger a 404, AND disableDEBUG
orTEMPLATE_DEBUG
in your settings (not sure which).If this isn't the case, then this is a bug with django's template loading system which should be addressed in a separate ticket.