Opened 6 years ago

Closed 5 years ago

Last modified 5 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@…> 5 years ago.
Documentation patch

Download all attachments as: .zip

Change History (10)

comment:1 Changed 6 years ago by anonymous

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

comment:2 Changed 5 years ago by Aymeric Augustin

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

Where is the patch? Resetting flags.

Changed 5 years ago by Martin Vilcans <martin@…>

Attachment: handler404.patch added

Documentation patch

comment:3 Changed 5 years ago by Martin Vilcans <martin@…>

Cc: martin@… added
Has patch: set

comment:4 Changed 5 years ago by Julien Phalip

Type: UncategorizedCleanup/optimization

See also #16214.

comment:5 Changed 5 years ago by Julien Phalip

Resolution: fixed
Status: newclosed

This was addressed in [16449].

comment:6 Changed 5 years ago by anonymous

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 Changed 5 years ago by Julien Phalip

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 5 years ago by Julien Phalip (previous) (diff)

comment:8 Changed 5 years ago by James Bennett

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 Changed 5 years ago by James Bennett

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