From 10e0cfc0e4e77b85e8261c908baf1c4814ded3f8 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Sat, 18 Jan 2014 19:34:54 +0100 Subject: Fixed #21712 -- Moved autodiscover() to AdminConfig.ready(). Thanks Marc Tamlyn for the initial version of the patch. --- docs/intro/tutorial03.txt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'docs/intro/tutorial03.txt') diff --git a/docs/intro/tutorial03.txt b/docs/intro/tutorial03.txt index 2e0159f1db..d443536c1a 100644 --- a/docs/intro/tutorial03.txt +++ b/docs/intro/tutorial03.txt @@ -105,15 +105,20 @@ with: :filename: mysite/urls.py from django.conf.urls import patterns, include, url - from django.contrib import admin - admin.autodiscover() urlpatterns = patterns('', url(r'^polls/', include('polls.urls')), url(r'^admin/', include(admin.site.urls)), ) +.. admonition:: Doesn't match what you see? + + If you're seeing ``admin.autodiscover()`` before the definition of + ``urlpatterns``, you're probably using a version of Django that doesn't + match this tutorial version. You'll want to either switch to the older + tutorial or the newer Django version. + You have now wired an ``index`` view into the URLconf. Go to http://localhost:8000/polls/ in your browser, and you should see the text "*Hello, world. You're at the polls index.*", which you defined in the @@ -587,9 +592,7 @@ it to include namespacing: :filename: mysite/urls.py from django.conf.urls import patterns, include, url - from django.contrib import admin - admin.autodiscover() urlpatterns = patterns('', url(r'^polls/', include('polls.urls', namespace="polls")), -- cgit v1.3