diff options
| author | David Sanders <dsanders@rapilabs.com> | 2015-08-28 17:55:17 +1000 |
|---|---|---|
| committer | Markus Holtermann <info@markusholtermann.eu> | 2015-08-31 14:39:31 +1000 |
| commit | 7a98442f9645102601c5a18b2ff93b7433e3a01d (patch) | |
| tree | 93abfa7ecaf147186d7725f32eea615d16ecc709 | |
| parent | b79fc11d730b5beff92e9dd8853a61524cdeffe3 (diff) | |
Clarified 404.html usage, excplicitly stated that it's used when DEBUG is False
Thanks to Keryn Knight, Curtis Maloney and Tim Graham for their reviews.
| -rw-r--r-- | docs/topics/http/views.txt | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/docs/topics/http/views.txt b/docs/topics/http/views.txt index 86657d2c65..26b28da6a2 100644 --- a/docs/topics/http/views.txt +++ b/docs/topics/http/views.txt @@ -122,14 +122,15 @@ Example usage:: raise Http404("Poll does not exist") return render_to_response('polls/detail.html', {'poll': p}) -In order to use the ``Http404`` exception to its fullest, you should create a -template that is displayed when a 404 error is raised. This template should be -called ``404.html`` and located in the top level of your template tree. +In order to show customized HTML when Django returns a 404, you can create an +HTML template named ``404.html`` and place it in the top level of your +template tree. This template will then be served when :setting:`DEBUG` is set +to ``False``. -If you provide a message when raising an ``Http404`` exception, it will appear -in the standard 404 template displayed when :setting:`DEBUG` is ``True``. Use -these messages for debugging purposes; they generally aren't suitable for use -in a production 404 template. +When :setting:`DEBUG` is ``True``, you can provide a message to ``Http404`` and +it will appear in the standard 404 debug template. Use these messages for +debugging purposes; they generally aren't suitable for use in a production 404 +template. .. _customizing-error-views: |
