Ticket #11959: 11959_r11594.diff
File 11959_r11594.diff, 2.6 KB (added by , 15 years ago) |
---|
-
docs/intro/tutorial02.txt
35 35 to :setting:`INSTALLED_APPS`, the database tables need to be updated. 36 36 37 37 * Edit your ``mysite/urls.py`` file and uncomment the lines below the 38 "Uncomment the next two lines..." comment. This file is a URLconf;39 we'll dig into URLconfs in the next tutorial. For now, all you need to40 know is that it maps URL roots to applications. In the end, you should41 have a ``urls.py`` file that looks like this:38 "Uncomment the next... to enable the admin" comments. This file is a 39 URLconf; we'll dig into URLconfs in the next tutorial. For now, all you 40 need to know is that it maps URL roots to applications. In the end, you 41 should have a ``urls.py`` file that looks like this: 42 42 43 43 .. versionchanged:: 1.1 44 44 The method for adding admin urls has changed in Django 1.1. -
docs/intro/tutorial03.txt
181 181 Take a look in your browser, at "/polls/34/". It'll display whatever ID you 182 182 provide in the URL. 183 183 184 Go ahead and copy that detail view twice and make similar placeholder 185 views named ``vote`` and ``results``. If you have URL patterns that 186 refer to nonexistent views, various other parts of Django (such as the 187 admin interface) won't work properly. 188 184 189 Write views that actually do something 185 190 ====================================== 186 191 … … 467 472 ``mysite/urls.py`` to remove the poll-specific URLs and insert an 468 473 :func:`~django.conf.urls.defaults.include`:: 469 474 470 ...475 #... 471 476 urlpatterns = patterns('', 472 477 (r'^polls/', include('mysite.polls.urls')), 473 ... 478 #... 479 ) 474 480 475 481 :func:`~django.conf.urls.defaults.include`, simply, references another URLconf. 476 482 Note that the regular expression doesn't have a ``$`` (end-of-string match -
docs/intro/tutorial04.txt
52 52 53 53 (r'^(?P<poll_id>\d+)/vote/$', 'vote'), 54 54 55 So let's create a ``vote()`` function in ``mysite/polls/views.py``:: 55 So let's modify our placeholder ``vote()`` function in 56 ``mysite/polls/views.py`` to look like this:: 56 57 57 58 from django.shortcuts import get_object_or_404, render_to_response 58 59 from django.http import HttpResponseRedirect