From 5de00f785f1cd83b0e480ffdebeca5977a3fa953 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Wed, 11 Jan 2006 02:06:27 +0000 Subject: 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 --- docs/tutorial04.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'docs/tutorial04.txt') 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\d+)/vote/$', 'myproject.apps.polls.views.vote'), + (r'^polls/(?P\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\d+)/$', 'detail'), (r'^(?P\d+)/results/$', 'results'), @@ -178,7 +178,7 @@ Change it like so:: (r'^$', 'django.views.generic.list_detail.object_list', info_dict), (r'^(?P\d+)/$', 'django.views.generic.list_detail.object_detail', info_dict), (r'^(?P\d+)/results/$', 'django.views.generic.list_detail.object_detail', dict(info_dict, template_name='polls/results')), - (r'^(?P\d+)/vote/$', 'myproject.apps.polls.views.vote'), + (r'^(?P\d+)/vote/$', 'myproject.polls.views.vote'), ) We're using two generic views here: ``object_list`` and ``object_detail``. -- cgit v1.3