diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2006-01-11 02:06:27 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2006-01-11 02:06:27 +0000 |
| commit | 5de00f785f1cd83b0e480ffdebeca5977a3fa953 (patch) | |
| tree | 727c7af91c1292846f528c7f5a0106eddef27702 /docs/tutorial04.txt | |
| parent | b94d78772f58da7610f714a32e55e96a1d09bea7 (diff) | |
Updated tutorials 1-4 to use manage.py instead of django-admin.py, new directory layout (no /apps/ subdirectory) and other various tweaks
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1901 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/tutorial04.txt')
| -rw-r--r-- | docs/tutorial04.txt | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/tutorial04.txt b/docs/tutorial04.txt index 7acb1343eb..f6a0abb6d1 100644 --- a/docs/tutorial04.txt +++ b/docs/tutorial04.txt @@ -44,9 +44,9 @@ Now, let's create a Django view that handles the submitted data and does something with it. Remember, in `Tutorial 3`_, we create a URLconf that included this line:: - (r'^polls/(?P<poll_id>\d+)/vote/$', 'myproject.apps.polls.views.vote'), + (r'^polls/(?P<poll_id>\d+)/vote/$', 'myproject.polls.views.vote'), -So let's create a ``vote()`` function in ``myproject/apps/polls/views.py``:: +So let's create a ``vote()`` function in ``myproject/polls/views.py``:: from django.core.extensions import get_object_or_404, render_to_response from django.models.polls import choices, polls @@ -158,7 +158,7 @@ so far:: from django.conf.urls.defaults import * - urlpatterns = patterns('myproject.apps.polls.views', + urlpatterns = patterns('myproject.polls.views', (r'^$', 'index'), (r'^(?P<poll_id>\d+)/$', 'detail'), (r'^(?P<poll_id>\d+)/results/$', 'results'), @@ -178,7 +178,7 @@ Change it like so:: (r'^$', 'django.views.generic.list_detail.object_list', info_dict), (r'^(?P<object_id>\d+)/$', 'django.views.generic.list_detail.object_detail', info_dict), (r'^(?P<object_id>\d+)/results/$', 'django.views.generic.list_detail.object_detail', dict(info_dict, template_name='polls/results')), - (r'^(?P<poll_id>\d+)/vote/$', 'myproject.apps.polls.views.vote'), + (r'^(?P<poll_id>\d+)/vote/$', 'myproject.polls.views.vote'), ) We're using two generic views here: ``object_list`` and ``object_detail``. |
