mirror of
https://github.com/django/django.git
synced 2025-07-24 05:36:15 +00:00
Fixed #9847 -- Added 403 response handler. Many thanks to kgrandis, adamnelson, vkryachko, fvox13 and Chris Beaven.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16606 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
958e049d4d
commit
1ca6e9b9e2
10 changed files with 103 additions and 12 deletions
|
@ -197,3 +197,24 @@ Two things to note about 500 views:
|
|||
* If :setting:`DEBUG` is set to ``True`` (in your settings module), then
|
||||
your 500 view will never be used, and the traceback will be displayed
|
||||
instead, with some debug information.
|
||||
|
||||
.. _http_forbidden_view:
|
||||
|
||||
The 403 (HTTP Forbidden) view
|
||||
----------------------------
|
||||
|
||||
.. versionadded:: 1.4
|
||||
|
||||
In the same vein as the 404 and 500 views, Django has a view to handle 403
|
||||
Forbidden errors. If a view results in a 403 exception then Django will, by
|
||||
default, call the view ``django.views.defaults.permission_denied``.
|
||||
|
||||
This view loads and renders the template ``403.html`` in your root template
|
||||
directory, or if this file does not exist, instead serves the text
|
||||
"403 Forbidden", as per RFC 2616 (the HTTP 1.1 Specification).
|
||||
|
||||
It is possible to override ``django.views.defaults.permission_denied`` in the
|
||||
same way you can for the 404 and 500 views by specifying a ``handler403`` in
|
||||
your URLconf::
|
||||
|
||||
handler403 = 'mysite.views.my_custom_permission_denied_view'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue