Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Made some improvements/clean-ups to docs/tutorial03.txt

git-svn-id: http://code.djangoproject.com/svn/django/trunk@430 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 03bd1d7ff9bae80694c09b57ca5737cce68b756b 1 parent 4003f9f
Adrian Holovaty authored August 08, 2005

Showing 1 changed file with 23 additions and 26 deletions. Show diff stats Hide diff stats

  1. 49  docs/tutorial03.txt
49  docs/tutorial03.txt
@@ -9,33 +9,32 @@ application and will focus on creating the public interface -- "views."
9 9
 
10 10
 .. _Tutorial 2: http://www.djangoproject.com/documentation/tutorial2/
11 11
 
12  
-.. admonition:: Philosophy
  12
+Philosophy
  13
+==========
13 14
 
14  
-    A view is a "type" of Web page in your Django application that generally
15  
-    serves a specific function and has a specific template. For example, in a
16  
-    weblog application, you might have the following views:
  15
+A view is a "type" of Web page in your Django application that generally serves
  16
+a specific function and has a specific template. For example, in a weblog
  17
+application, you might have the following views:
17 18
 
18  
-        * Blog homepage -- displays the latest few entries.
19  
-        * Entry "detail" page -- permalink page for a single entry.
20  
-        * Year-based archive page -- displays all months with entries in the
21  
-          given year.
22  
-        * Month-based archive page -- displays all days with entries in the
23  
-          given month.
24  
-        * Day-based archive page -- displays all entries in the given day.
25  
-        * Comment action -- handles posting comments to a given entry.
  19
+    * Blog homepage -- displays the latest few entries.
  20
+    * Entry "detail" page -- permalink page for a single entry.
  21
+    * Year-based archive page -- displays all months with entries in the
  22
+        given year.
  23
+    * Month-based archive page -- displays all days with entries in the
  24
+        given month.
  25
+    * Day-based archive page -- displays all entries in the given day.
  26
+    * Comment action -- handles posting comments to a given entry.
26 27
 
27  
-    In our poll application, we'll have the following four views:
28  
-
29  
-        * Poll "archive" page -- displays the latest few polls.
30  
-        * Poll "detail" page -- displays a poll question, with no results but
31  
-          with a form to vote.
32  
-        * Poll "results" page -- displays results for a particular poll.
33  
-        * Vote action -- handles voting for a particular choice in a particular
34  
-          poll.
35  
-
36  
-    In Django, each view is represented by a simple Python function.
  28
+In our poll application, we'll have the following four views:
37 29
 
  30
+    * Poll "archive" page -- displays the latest few polls.
  31
+    * Poll "detail" page -- displays a poll question, with no results but
  32
+        with a form to vote.
  33
+    * Poll "results" page -- displays results for a particular poll.
  34
+    * Vote action -- handles voting for a particular choice in a particular
  35
+        poll.
38 36
 
  37
+In Django, each view is represented by a simple Python function.
39 38
 
40 39
 Design your URLs
41 40
 ================
@@ -130,8 +129,8 @@ change the ``settings`` parameter.)
130 129
 Now go to "http://localhost:8000/polls/" on your domain in your Web browser.
131 130
 You should get a Python traceback with the following error message::
132 131
 
133  
-    ViewDoesNotExist: Tried myproject.apps.polls.views.polls.index.
134  
-    No module named polls
  132
+    ViewDoesNotExist: Could not import myproject.apps.polls.views.polls. Error
  133
+    was: No module named polls
135 134
 
136 135
 Try "/polls/23/", "/polls/23/results/" and "/polls/23/vote/". The error
137 136
 messages should tell you which view Django tried (and failed to find, because
@@ -379,8 +378,6 @@ URLs and insert an ``include()``::
379 378
 
380 379
     (r'^polls/', include('myproject.apps.polls.urls.polls')),
381 380
 
382  
-Notes:
383  
-
384 381
 ``include()``, simply, references another URLconf. Note that the regular
385 382
 expression doesn't have a ``$`` (end-of-string match character) but has the
386 383
 trailing slash. Whenever Django encounters ``include()``, it chops off whatever

0 notes on commit 03bd1d7

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