diff options
| author | Tim Graham <timograham@gmail.com> | 2013-12-26 20:04:28 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2013-12-26 20:06:29 -0500 |
| commit | f3a9a761238977b7db9a2f8449207cd439be235e (patch) | |
| tree | 25a28bae1a1f42058708e4d3de625de857aa05b0 /docs | |
| parent | 62f282a265ae7f8d051f7ce79788cfc1a84d1a24 (diff) | |
[1.6.x] Fixed #21582 -- Corrected URL namespace example.
Thanks oubiga for the report.
Backport of 025ec2e7fe from master
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/topics/http/urls.txt | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/docs/topics/http/urls.txt b/docs/topics/http/urls.txt index 2ddb7cc0fe..c7a9d0a494 100644 --- a/docs/topics/http/urls.txt +++ b/docs/topics/http/urls.txt @@ -866,7 +866,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. @@ -877,3 +877,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. |
