From 74c38bad1d80ff94a973f4c4608011f45e80f2d9 Mon Sep 17 00:00:00 2001 From: Alasdair Nicol Date: Wed, 1 Oct 2014 01:06:01 +0100 Subject: [PATCH] [1.7.x] Fixed #23578 -- Changed examples in docs to use patterns --- docs/topics/http/urls.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/topics/http/urls.txt b/docs/topics/http/urls.txt index a306434d95..d9b0a1e466 100644 --- a/docs/topics/http/urls.txt +++ b/docs/topics/http/urls.txt @@ -834,25 +834,25 @@ displaying polls. .. snippet:: :filename: urls.py - from django.conf.urls import include, url + from django.conf.urls import include, patterns, url - urlpatterns = [ + urlpatterns = patterns('', url(r'^author-polls/', include('polls.urls', namespace='author-polls', app_name='polls')), url(r'^publisher-polls/', include('polls.urls', namespace='publisher-polls', app_name='polls')), - ] + ) .. snippet:: :filename: polls/urls.py - from django.conf.urls import url + from django.conf.urls import patterns, url from . import views - urlpatterns = [ + urlpatterns = patterns('', url(r'^$', views.IndexView.as_view(), name='index'), url(r'^(?P\d+)/$', views.DetailView.as_view(), name='detail'), ... - ] + ) Using this setup, the following lookups are possible: @@ -921,14 +921,14 @@ However, you can also ``include()`` a 3-tuple containing:: For example:: - from django.conf.urls import include, url + from django.conf.urls import include, patterns, url from . import views - polls_patterns = [ + polls_patterns = patterns('', url(r'^$', views.IndexView.as_view(), name='index'), url(r'^(?P\d+)/$', views.DetailView.as_view(), name='detail'), - ] + ) url(r'^polls/', include((polls_patterns, 'polls', 'author-polls'))),