Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #11272 -- Made some clarifications to the overview and tutorial…

…. Thanks to jjinux for the review notes.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@11044 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 457a1f9a031543e3d5d1cfb3944712fe71ebba2f 1 parent bc362cc
Russell Keith-Magee authored
10  docs/intro/overview.txt
@@ -144,10 +144,10 @@ as registering your model in the admin site::
144 144
         headline = models.CharField(max_length=200)
145 145
         content = models.TextField()
146 146
         reporter = models.ForeignKey(Reporter)
147  
-        
  147
+
148 148
 
149 149
     # In admin.py in the same directory...
150  
-    
  150
+
151 151
     import models
152 152
     from django.contrib import admin
153 153
 
@@ -243,9 +243,9 @@ might look like:
243 243
     <h1>Articles for {{ year }}</h1>
244 244
 
245 245
     {% for article in article_list %}
246  
-    <p>{{ article.headline }}</p>
247  
-    <p>By {{ article.reporter.full_name }}</p>
248  
-    <p>Published {{ article.pub_date|date:"F j, Y" }}</p>
  246
+        <p>{{ article.headline }}</p>
  247
+        <p>By {{ article.reporter.full_name }}</p>
  248
+        <p>Published {{ article.pub_date|date:"F j, Y" }}</p>
249 249
     {% endfor %}
250 250
     {% endblock %}
251 251
 
36  docs/intro/tutorial01.txt
@@ -42,13 +42,13 @@ code, then run the command ``django-admin.py startproject mysite``. This will
42 42
 create a ``mysite`` directory in your current directory.
43 43
 
44 44
 .. admonition:: Mac OS X permissions
45  
-   
  45
+
46 46
    If you're using Mac OS X, you may see the message "permission denied" when
47 47
    you try to run ``django-admin.py startproject``. This is because, on
48 48
    Unix-based systems like OS X, a file must be marked as "executable" before it
49 49
    can be run as a program. To do this, open Terminal.app and navigate (using
50 50
    the ``cd`` command) to the directory where :ref:`django-admin.py
51  
-   <ref-django-admin>` is installed, then run the command 
  51
+   <ref-django-admin>` is installed, then run the command
52 52
    ``chmod +x django-admin.py``.
53 53
 
54 54
 .. note::
@@ -90,14 +90,14 @@ These files are:
90 90
     * :file:`__init__.py`: An empty file that tells Python that this directory
91 91
       should be considered a Python package. (Read `more about packages`_ in the
92 92
       official Python docs if you're a Python beginner.)
93  
-      
  93
+
94 94
     * :file:`manage.py`: A command-line utility that lets you interact with this
95 95
       Django project in various ways. You can read all the details about
96 96
       :file:`manage.py` in :ref:`ref-django-admin`.
97  
-      
  97
+
98 98
     * :file:`settings.py`: Settings/configuration for this Django project.
99 99
       :ref:`topics-settings` will tell you all about how settings work.
100  
-    
  100
+
101 101
     * :file:`urls.py`: The URL declarations for this Django project; a "table of
102 102
       contents" of your Django-powered site. You can read more about URLs in
103 103
       :ref:`topics-http-urls`.
@@ -134,22 +134,22 @@ It worked!
134 134
 .. admonition:: Changing the port
135 135
 
136 136
     By default, the :djadmin:`runserver` command starts the development server
137  
-    on the internal IP at port 8000. 
138  
-    
  137
+    on the internal IP at port 8000.
  138
+
139 139
     If you want to change the server's port, pass
140 140
     it as a command-line argument. For instance, this command starts the server
141 141
     on port 8080:
142  
-    
  142
+
143 143
     .. code-block:: bash
144 144
 
145 145
         python manage.py runserver 8080
146  
-        
  146
+
147 147
     If you want to change the server's IP, pass it along with the port. So to
148 148
     listen on all public IPs (useful if you want to show off your work on other
149 149
     computers), use:
150  
-    
  150
+
151 151
     .. code-block:: bash
152  
-    
  152
+
153 153
         python manage.py runserver 0.0.0.0:8000
154 154
 
155 155
     Full docs for the development server can be found in the
@@ -164,21 +164,21 @@ database's connection parameters:
164 164
 
165 165
     * :setting:`DATABASE_ENGINE` -- Either 'postgresql_psycopg2', 'mysql' or
166 166
       'sqlite3'. Other backends are :setting:`also available <DATABASE_ENGINE>`.
167  
-      
  167
+
168 168
     * :setting:`DATABASE_NAME` -- The name of your database. If you're using
169 169
       SQLite, the database will be a file on your computer; in that case,
170 170
       ``DATABASE_NAME`` should be the full absolute path, including filename, of
171 171
       that file. If the file doesn't exist, it will automatically be created
172 172
       when you synchronize the database for the first time (see below).
173  
-      
174  
-      When specifying the path, always use forward slashes, even on Windows 
  173
+
  174
+      When specifying the path, always use forward slashes, even on Windows
175 175
       (e.g. ``C:/homes/user/mysite/sqlite3.db``).
176  
-      
  176
+
177 177
     * :setting:`DATABASE_USER` -- Your database username (not used for SQLite).
178  
-    
  178
+
179 179
     * :setting:`DATABASE_PASSWORD` -- Your database password (not used for
180 180
       SQLite).
181  
-    
  181
+
182 182
     * :setting:`DATABASE_HOST` -- The host your database is on. Leave this as an
183 183
       empty string if your database server is on the same physical machine (not
184 184
       used for SQLite).
@@ -594,7 +594,7 @@ your models, not only for your own sanity when dealing with the interactive
594 594
 prompt, but also because objects' representations are used throughout Django's
595 595
 automatically-generated admin.
596 596
 
597  
-.. admonition:: Why :meth:`~django.db.models.Model.__unicode__` and not 
  597
+.. admonition:: Why :meth:`~django.db.models.Model.__unicode__` and not
598 598
                 :meth:`~django.db.models.Model.__str__`?
599 599
 
600 600
     If you're familiar with Python, you might be in the habit of adding
8  docs/intro/tutorial02.txt
@@ -86,8 +86,8 @@ Enter the admin site
86 86
 ====================
87 87
 
88 88
 Now, try logging in. (You created a superuser account in the first part of this
89  
-tutorial, remember?  If you didn't create one or forgot the password you can 
90  
-:ref:`create another one <topics-auth-creating-superusers>`.) You should see 
  89
+tutorial, remember?  If you didn't create one or forgot the password you can
  90
+:ref:`create another one <topics-auth-creating-superusers>`.) You should see
91 91
 the Django admin index page:
92 92
 
93 93
 .. image:: _images/admin02t.png
@@ -238,8 +238,8 @@ the admin page doesn't display choices.
238 238
 
239 239
 Yet.
240 240
 
241  
-There are two ways to solve this problem. The first register ``Choice`` with the
242  
-admin just as we did with ``Poll``. That's easy::
  241
+There are two ways to solve this problem. The first is to register ``Choice``
  242
+with the admin just as we did with ``Poll``. That's easy::
243 243
 
244 244
     from mysite.polls.models import Choice
245 245
 
8  docs/intro/tutorial03.txt
@@ -71,7 +71,7 @@ For more on :class:`~django.http.HttpRequest` objects, see the
71 71
 :ref:`ref-request-response`. For more details on URLconfs, see the
72 72
 :ref:`topics-http-urls`.
73 73
 
74  
-When you ran ``python django-admin.py startproject mysite`` at the beginning of
  74
+When you ran ``django-admin.py startproject mysite`` at the beginning of
75 75
 Tutorial 1, it created a default URLconf in ``mysite/urls.py``. It also
76 76
 automatically set your :setting:`ROOT_URLCONF` setting (in ``settings.py``) to
77 77
 point at that file::
@@ -98,8 +98,7 @@ This is worth a review. When somebody requests a page from your Web site -- say,
98 98
 the :setting:`ROOT_URLCONF` setting. It finds the variable named ``urlpatterns``
99 99
 and traverses the regular expressions in order. When it finds a regular
100 100
 expression that matches -- ``r'^polls/(?P<poll_id>\d+)/$'`` -- it loads the
101  
-associated Python package/module: ``mysite.polls.views.detail``. That
102  
-corresponds to the function ``detail()`` in ``mysite/polls/views.py``. Finally,
  101
+function ``detail()`` from ``mysite/polls/views.py``. Finally,
103 102
 it calls that ``detail()`` function like so::
104 103
 
105 104
     detail(request=<HttpRequest object>, poll_id='23')
@@ -486,7 +485,8 @@ Here's what happens if a user goes to "/polls/34/" in this system:
486 485
       further processing.
487 486
 
488 487
 Now that we've decoupled that, we need to decouple the 'mysite.polls.urls'
489  
-URLconf by removing the leading "polls/" from each line::
  488
+URLconf by removing the leading "polls/" from each line, and removing the
  489
+lines registering the admin site::
490 490
 
491 491
     urlpatterns = patterns('mysite.polls.views',
492 492
         (r'^$', 'index'),
4  docs/ref/contrib/contenttypes.txt
@@ -347,8 +347,8 @@ doesn't work with a
347 347
 :class:`~django.contrib.contenttypes.generic.GenericRelation`. For example, you
348 348
 might be tempted to try something like::
349 349
 
350  
-    Bookmark.objects.aggregate(Count('tags')) 
351  
-     
  350
+    Bookmark.objects.aggregate(Count('tags'))
  351
+
352 352
 This will not work correctly, however. The generic relation adds extra filters
353 353
 to the queryset to ensure the correct content type, but the ``aggregate`` method
354 354
 doesn't take them into account. For now, if you need aggregates on generic
3  docs/topics/http/sessions.txt
@@ -4,6 +4,9 @@
4 4
 How to use sessions
5 5
 ===================
6 6
 
  7
+.. module:: django.contrib.sessions
  8
+   :synopsis: Provides session management for Django projects.
  9
+
7 10
 Django provides full support for anonymous sessions. The session framework lets
8 11
 you store and retrieve arbitrary data on a per-site-visitor basis. It stores
9 12
 data on the server side and abstracts the sending and receiving of cookies.

0 notes on commit 457a1f9

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