Refs #21927 -- Added note about include() to tutorial.

This commit is contained in:
Marten Kenbeek 2015-12-30 17:13:58 +01:00 committed by Tim Graham
parent 00cb9e13b4
commit 6687f4dcbb
1 changed files with 5 additions and 0 deletions

View File

@ -298,6 +298,11 @@ an :func:`~django.conf.urls.include` in the ``urlpatterns`` list, so you have:
url(r'^admin/', admin.site.urls), url(r'^admin/', admin.site.urls),
] ]
.. admonition:: When to use :func:`~django.conf.urls.include()`
You should always use ``include()`` when you include other URL patterns.
``admin.site.urls`` is the only exception to this.
.. admonition:: Doesn't match what you see? .. admonition:: Doesn't match what you see?
If you're seeing ``include(admin.site.urls)`` instead of just If you're seeing ``include(admin.site.urls)`` instead of just