1
0
mirror of https://github.com/django/django.git synced 2025-07-18 16:49:13 +00:00

[1.0.X] Fixed #11272 -- Made some clarifications to the overview and tutorial. Thanks to jjinux for the review notes.

Merge of r11044 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@11056 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee 2009-06-18 14:13:50 +00:00
parent 4a79eaac97
commit 58e4a9d938
5 changed files with 34 additions and 31 deletions

View File

@ -235,8 +235,8 @@ the admin page doesn't display choices.
Yet.
There are two ways to solve this problem. The first register ``Choice`` with the
admin just as we did with ``Poll``. That's easy::
There are two ways to solve this problem. The first is to register ``Choice``
with the admin just as we did with ``Poll``. That's easy::
from mysite.polls.models import Choice

View File

@ -71,7 +71,7 @@ For more on :class:`~django.http.HttpRequest` objects, see the
:ref:`ref-request-response`. For more details on URLconfs, see the
:ref:`topics-http-urls`.
When you ran ``python django-admin.py startproject mysite`` at the beginning of
When you ran ``django-admin.py startproject mysite`` at the beginning of
Tutorial 1, it created a default URLconf in ``mysite/urls.py``. It also
automatically set your :setting:`ROOT_URLCONF` setting (in ``settings.py``) to
point at that file::
@ -98,8 +98,7 @@ This is worth a review. When somebody requests a page from your Web site -- say,
the :setting:`ROOT_URLCONF` setting. It finds the variable named ``urlpatterns``
and traverses the regular expressions in order. When it finds a regular
expression that matches -- ``r'^polls/(?P<poll_id>\d+)/$'`` -- it loads the
associated Python package/module: ``mysite.polls.views.detail``. That
corresponds to the function ``detail()`` in ``mysite/polls/views.py``. Finally,
function ``detail()`` from ``mysite/polls/views.py``. Finally,
it calls that ``detail()`` function like so::
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:
further processing.
Now that we've decoupled that, we need to decouple the 'mysite.polls.urls'
URLconf by removing the leading "polls/" from each line::
URLconf by removing the leading "polls/" from each line, and removing the
lines registering the admin site::
urlpatterns = patterns('mysite.polls.views',
(r'^$', 'index'),

View File

@ -4,6 +4,9 @@
How to use sessions
===================
.. module:: django.contrib.sessions
:synopsis: Provides session management for Django projects.
Django provides full support for anonymous sessions. The session framework lets
you store and retrieve arbitrary data on a per-site-visitor basis. It stores
data on the server side and abstracts the sending and receiving of cookies.