From 66ada281d5842da82f1fdc813b941ebb04dec6e3 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Thu, 26 Dec 2013 20:04:28 -0500 Subject: [PATCH] [1.5.x] Fixed #21582 -- Corrected URL namespace example. Thanks oubiga for the report. Backport of 025ec2e7fe from master --- docs/topics/http/urls.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/topics/http/urls.txt b/docs/topics/http/urls.txt index 0c17957210..a4c8561c5d 100644 --- a/docs/topics/http/urls.txt +++ b/docs/topics/http/urls.txt @@ -839,7 +839,7 @@ For example:: url(r'^advanced/$', 'apps.help.views.views.advanced'), ) - url(r'^help/', include(help_patterns, 'bar', 'foo')), + url(r'^help/', include((help_patterns, 'bar', 'foo'))), This will include the nominated URL patterns into the given application and instance namespace. @@ -850,3 +850,8 @@ attribute: A 3-tuple that contains all the patterns in the corresponding admin site, plus the application namespace ``'admin'``, and the name of the admin instance. It is this ``urls`` attribute that you ``include()`` into your projects ``urlpatterns`` when you deploy an Admin instance. + +Be sure to pass a tuple to ``include()``. If you simply pass three arguments: +``include(help_patterns, 'bar', 'foo')``, Django won't throw an error but due +to the signature of ``include()``, ``'bar'`` will be the instance namespace and +``'foo'`` will be the application namespace instead of vice versa.