1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

[1.11.x] Fixed #27874 -- Fixed URL namespace warning (urls.W005) for nested namespaces.

Backport of 8d4885ede5 from master
This commit is contained in:
Chris Lamb
2017-02-24 23:13:48 +08:00
committed by Tim Graham
parent a86ec78fe6
commit 0417bf47a6
2 changed files with 12 additions and 4 deletions

View File

@@ -5,7 +5,14 @@ common_url_patterns = ([
url(r'^app-url/', include([])),
], 'common')
nested_url_patterns = ([
url(r'^common/', include(common_url_patterns, namespace='nested')),
], 'nested')
urlpatterns = [
url(r'^app-ns1-0/', include(common_url_patterns, namespace='app-include-1')),
url(r'^app-ns1-1/', include(common_url_patterns, namespace='app-include-2'))
url(r'^app-ns1-1/', include(common_url_patterns, namespace='app-include-2')),
# 'nested' is included twice but namespaced by nested-1 and nested-2.
url(r'^app-ns1-2/', include(nested_url_patterns, namespace='nested-1')),
url(r'^app-ns1-3/', include(nested_url_patterns, namespace='nested-2')),
]