Opened 14 years ago

Closed 13 years ago

Last modified 13 years ago

#16079 closed Cleanup/optimization (fixed)

Clarify that handler404 and handler500 only applies to project

Reported by: Martin Vilcans <martin@…> Owned by: nobody
Component: Documentation Version: 1.3
Severity: Normal Keywords:
Cc: martin@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

The documentation states that you can define handler404 and handler500 in your URLconf, but it doesn't say that this only works in the project-level URLconf, not inside an app.

I think it should be mentioned in these sections:

http://docs.djangoproject.com/en/dev/topics/http/urls/#handler404

http://docs.djangoproject.com/en/dev/intro/tutorial03/#write-a-404-page-not-found-view

There are several questions about this at Stack Overflow (for example http://stackoverflow.com/questions/3309076/is-it-possible-to-include-a-custom-404-view-for-a-django-app-without-changing-any), so if the documentation could just say that it's impossible, it would save time for a lot of people.

Attachments (1)

handler404.patch (1.3 KB ) - added by Martin Vilcans <martin@…> 14 years ago.
Documentation patch

Download all attachments as: .zip

Change History (10)

comment:1 by anonymous, 14 years ago

Has patch: set
Needs documentation: set
Triage Stage: UnreviewedAccepted

comment:2 by Aymeric Augustin, 14 years ago

Has patch: unset
Needs documentation: unset
UI/UX: unset

Where is the patch? Resetting flags.

by Martin Vilcans <martin@…>, 14 years ago

Attachment: handler404.patch added

Documentation patch

comment:3 by Martin Vilcans <martin@…>, 14 years ago

Cc: martin@… added
Has patch: set

comment:4 by Julien Phalip, 14 years ago

Type: UncategorizedCleanup/optimization

See also #16214.

comment:5 by Julien Phalip, 13 years ago

Resolution: fixed
Status: newclosed

This was addressed in [16449].

comment:6 by anonymous, 13 years ago

Resolution: fixed
Status: closedreopened

I disagree. [16449] does not address this problem. The documentation still doesn't say anything about that the handlers only work in the project-level URLconf.

comment:7 by Julien Phalip, 13 years ago

Patch needs improvement: set

Well, it now says that the handlers have to be declared in the "root URLconf". More clarification can always be added. In that case, the same type of clarification should be made for handler500. Please also generate your patch from the root of the source tree. Thanks!

Last edited 13 years ago by Julien Phalip (previous) (diff)

comment:8 by James Bennett, 13 years ago

Resolution: fixed
Status: reopenedclosed

In [16804]:

Fixed #16079: Clarified (for real this time) how handler404 and handler500 work, and that they only work in a root URLconf.

comment:9 by James Bennett, 13 years ago

In [16805]:

[1.3.X] Fixed #16079: Clarified (for real this time) how handler404 and handler500 work, and that they only work in a root URLconf. Backport of [16804] from trunk.

Note: See TracTickets for help on using tickets.
Back to Top