Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #17538 -- corrected the section in tutorial 3 about the handler…

…404 default. Thanks matt at brozowski dot com for the report.

Backport of r17369 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.3.X@17370 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 9bc6119daf03d5f33095f52b5eac1aed1359c775 1 parent 9e12492
Carl Meyer authored January 12, 2012

Showing 1 changed file with 8 additions and 18 deletions. Show diff stats Hide diff stats

  1. 26  docs/intro/tutorial03.txt
26  docs/intro/tutorial03.txt
@@ -365,16 +365,15 @@ have no effect), which is a string in Python dotted syntax -- the same
365 365
 format the normal URLconf callbacks use. A 404 view itself has nothing
366 366
 special: It's just a normal view.
367 367
 
368  
-You normally won't have to bother with writing 404 views. By default, URLconfs
369  
-have the following line up top::
  368
+You normally won't have to bother with writing 404 views. If you don't set
  369
+``handler404``, the built-in view :func:`django.views.defaults.page_not_found`
  370
+is used by default. In this case, you still have one obligation: To create a
  371
+``404.html`` template in the root of your template directory. The default 404
  372
+view will use that template for all 404 errors. If :setting:`DEBUG` is set to
  373
+``False`` (in your settings module) and if you didn't create a ``404.html``
  374
+file, an ``Http500`` is raised instead.  So remember to create a ``404.html``.
370 375
 
371  
-    from django.conf.urls.defaults import *
372  
-
373  
-That takes care of setting ``handler404`` in the current module. As you can see
374  
-in ``django/conf/urls/defaults.py``, ``handler404`` is set to
375  
-:func:`django.views.defaults.page_not_found` by default.
376  
-
377  
-Four more things to note about 404 views:
  376
+A couple more things to note about 404 views:
378 377
 
379 378
     * If :setting:`DEBUG` is set to ``True`` (in your settings module) then your
380 379
       404 view will never be used (and thus the ``404.html`` template will never
@@ -383,15 +382,6 @@ Four more things to note about 404 views:
383 382
     * The 404 view is also called if Django doesn't find a match after checking
384 383
       every regular expression in the URLconf.
385 384
 
386  
-    * If you don't define your own 404 view -- and simply use the default, which
387  
-      is recommended -- you still have one obligation: To create a ``404.html``
388  
-      template in the root of your template directory. The default 404 view will
389  
-      use that template for all 404 errors.
390  
-
391  
-    * If :setting:`DEBUG` is set to ``False`` (in your settings module) and if
392  
-      you didn't create a ``404.html`` file, an ``Http500`` is raised instead.
393  
-      So remember to create a ``404.html``.
394  
-
395 385
 Write a 500 (server error) view
396 386
 ===============================
397 387
 

0 notes on commit 9bc6119

Please sign in to comment.
Something went wrong with that request. Please try again.