From 35fd2a6fd53c758b9804596dd0e81f5bd71e7ea5 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Mon, 4 Jan 2016 20:11:20 -0500 Subject: [1.9.x] Fixed #25878 -- Documented requirement that handler404 return a 404 response. Backport of 49eeb0f570c91af5064d9e4ac8649e9afa0236ec from master --- docs/ref/urls.txt | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'docs/ref') diff --git a/docs/ref/urls.txt b/docs/ref/urls.txt index 1fb9375b79..1d55ba05b6 100644 --- a/docs/ref/urls.txt +++ b/docs/ref/urls.txt @@ -183,8 +183,9 @@ A callable, or a string representing the full Python import path to the view that should be called if the HTTP client has sent a request that caused an error condition and a response with a status code of 400. -By default, this is ``'django.views.defaults.bad_request'``. That default -value should suffice. +By default, this is ``'django.views.defaults.bad_request'``. If you +implement a custom view, be sure it returns an +:class:`~django.http.HttpResponseBadRequest`. See the documentation about :ref:`the 400 (bad request) view ` for more information. @@ -198,8 +199,9 @@ A callable, or a string representing the full Python import path to the view that should be called if the user doesn't have the permissions required to access a resource. -By default, this is ``'django.views.defaults.permission_denied'``. That default -value should suffice. +By default, this is ``'django.views.defaults.permission_denied'``. If you +implement a custom view, be sure it returns an +:class:`~django.http.HttpResponseForbidden`. See the documentation about :ref:`the 403 (HTTP Forbidden) view ` for more information. @@ -212,8 +214,9 @@ handler404 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. +By default, this is ``'django.views.defaults.page_not_found'``. If you +implement a custom view, be sure it returns an +:class:`~django.http.HttpResponseNotFound`. See the documentation about :ref:`the 404 (HTTP Not Found) view ` for more information. @@ -227,8 +230,9 @@ 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. +By default, this is ``'django.views.defaults.server_error'``. If you +implement a custom view, be sure it returns an +:class:`~django.http.HttpResponseServerError`. See the documentation about :ref:`the 500 (HTTP Internal Server Error) view ` for more information. -- cgit v1.3