Ticket #6286: 6286.diff
File 6286.diff, 1.6 KB (added by , 16 years ago) |
---|
-
docs/intro/tutorial03.txt
89 89 (r'^polls/(?P<poll_id>\d+)/vote/$', 'mysite.polls.views.vote'), 90 90 ) 91 91 92 (Note that you remove the ``admin`` views because including them would result 93 in ``ViewDoesNotExist`` exceptions when trying to convert URLs to views because 94 the ``polls`` views haven't been written yet. You'll re-enable the admin in 95 part 4 of this tutorial.) 96 92 97 This is worth a review. When somebody requests a page from your Web site -- say, 93 98 "/polls/23/", Django will load this Python module, because it's pointed to by 94 99 the :setting:`ROOT_URLCONF` setting. It finds the variable named ``urlpatterns`` -
docs/intro/tutorial04.txt
153 153 results page that gets updated each time you vote. If you submit the form 154 154 without having chosen a choice, you should see the error message. 155 155 156 157 Now that all of the ``polls`` views exist, you can re-enable the admin site. 158 159 Change ``mysite/urls.py`` so it adds the admin site URL entry to ``urlpatterns``:: 160 161 from django.conf.urls.defaults import * 162 from django.contrib import admin 163 admin.autodiscover() 164 165 urlpatterns = patterns('', 166 (r'^polls/', include('mysite.polls.urls')), 167 (r'^admin/', include('django.contrib.admin.urls')), 168 ) 169 156 170 Use generic views: Less code is better 157 171 ====================================== 158 172