Skip to content

Commit

Permalink
Fixed #6278 -- Documented that the 404 template is passed a RequestCo…
Browse files Browse the repository at this point in the history
…ntext and the 500 handler is not. Thanks, Rob Hudson.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7081 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
malcolmt committed Feb 4, 2008
1 parent 5f47776 commit 6674718
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions docs/request_response.txt
Expand Up @@ -575,6 +575,10 @@ Three things to note about 404 views:
to the template: ``request_path``, which is the URL that resulted
in the 404.

* The 404 view is passed a ``RequestContext`` and will have access to
variables supplied by your ``TEMPLATE_CONTEXT_PROCESSORS`` (e.g.
``MEDIA_URL``).

* If ``DEBUG`` is set to ``True`` (in your settings module), then your 404
view will never be used, and the traceback will be displayed instead.

Expand All @@ -587,8 +591,9 @@ the view ``django.views.defaults.server_error``, which loads and renders the
template ``500.html``.

This means you need to define a ``500.html`` template in your root template
directory. This template will be used for all server errors. The
default 500 view passes no variables to this template.
directory. This template will be used for all server errors. The default 500
view passes no variables to this template and is rendered with an empty
``Context`` to lessen the chance of additional errors.

This ``server_error`` view should suffice for 99% of Web applications, but if
you want to override the view, you can specify ``handler500`` in your
Expand Down

0 comments on commit 6674718

Please sign in to comment.