Fixed #10326: handler500 and handler404 may now be callables. Thanks, dcwatson, adurdin.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@11854 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jacob Kaplan-Moss 2009-12-13 20:29:04 +00:00
parent 125403ca97
commit 1c5fe467bd
5 changed files with 51 additions and 8 deletions

View file

@ -253,24 +253,30 @@ handler404
.. data:: handler404
A string representing the full Python import path to the view that should be
called if none of the URL patterns match.
A callable, or a string representing the full Python import path to the view
that should be called if none of the URL patterns match.
By default, this is ``'django.views.defaults.page_not_found'``. That default
value should suffice.
.. versionchanged:: 1.2
Previous versions of Django only accepted strings representing import paths.
handler500
----------
.. data:: handler500
A string representing the full Python import path to the view that should be
called in case of server errors. Server errors happen when you have runtime
errors in view code.
A callable, or a string representing the full Python import path to the view
that should be called in case of server errors. Server errors happen when you
have runtime errors in view code.
By default, this is ``'django.views.defaults.server_error'``. That default
value should suffice.
.. versionchanged:: 1.2
Previous versions of Django only accepted strings representing import paths.
include
-------