Ticket #6286: 6286.diff

File 6286.diff, 1.6 KB (added by timo, 6 years ago)

fixed typo

  • docs/intro/tutorial03.txt

     
    8989        (r'^polls/(?P<poll_id>\d+)/vote/$', 'mysite.polls.views.vote'),
    9090    )
    9191
     92(Note that you remove the ``admin`` views because including them would result
     93in ``ViewDoesNotExist`` exceptions when trying to convert URLs to views because
     94the ``polls`` views haven't been written yet.  You'll re-enable the admin in
     95part 4 of this tutorial.)
     96
    9297This is worth a review. When somebody requests a page from your Web site -- say,
    9398"/polls/23/", Django will load this Python module, because it's pointed to by
    9499the :setting:`ROOT_URLCONF` setting. It finds the variable named ``urlpatterns``
  • docs/intro/tutorial04.txt

     
    153153results page that gets updated each time you vote. If you submit the form
    154154without having chosen a choice, you should see the error message.
    155155
     156
     157Now that all of the ``polls`` views exist, you can re-enable the admin site.
     158
     159Change ``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
    156170Use generic views: Less code is better
    157171======================================
    158172
Back to Top