Code

Opened 3 years ago

Closed 3 years ago

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

Download all attachments as: .zip

Change History (10)

comment:1 Changed 3 years ago by anonymous

  • Has patch set
  • Needs documentation set
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 3 years ago by aaugustin

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

Where is the patch? Resetting flags.

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

Documentation patch

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

  • Cc martin@… added
  • Has patch set

comment:4 Changed 3 years ago by julien

  • Type changed from Uncategorized to Cleanup/optimization

See also #16214.

comment:5 Changed 3 years ago by julien

  • Resolution set to fixed
  • Status changed from new to closed

This was addressed in [16449].

comment:6 Changed 3 years ago by anonymous

  • Resolution fixed deleted
  • Status changed from closed to reopened

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 3 years ago by julien

  • 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 source tree. Thanks!

Version 0, edited 3 years ago by julien (next)

comment:8 Changed 3 years ago by ubernostrum

  • Resolution set to fixed
  • Status changed from reopened to closed

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 3 years ago by ubernostrum

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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.