summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2017-09-13 15:24:12 -0400
committerTim Graham <timograham@gmail.com>2017-09-13 16:32:03 -0400
commitee4043f7355f077583ca4c1749db7d5211f0855e (patch)
tree8483c316d4134b013abe2ccfb0b931f039b1ac65 /docs
parent0214f367bc84d7217e42ae0441d500d31c6a5b78 (diff)
Refs #28593 -- Moved django.conf.urls.include() to django.urls().
The old location remains for backwards compatibility. Documentation will be updated separately along with the rest of the URL routing changes.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/urls.txt82
1 files changed, 48 insertions, 34 deletions
diff --git a/docs/ref/urls.txt b/docs/ref/urls.txt
index d44cce80da..3b6a66032d 100644
--- a/docs/ref/urls.txt
+++ b/docs/ref/urls.txt
@@ -1,6 +1,51 @@
-======================================
-``django.conf.urls`` utility functions
-======================================
+=============================================
+``django.urls`` functions for use in URLconfs
+=============================================
+
+.. module:: django.urls.conf
+ :synopsis: Functions for use in URLconfs.
+
+.. currentmodule:: django.conf.urls
+
+``include()``
+=============
+
+.. function:: include(module, namespace=None)
+ include(pattern_list)
+ include((pattern_list, app_namespace), namespace=None)
+
+ A function that takes a full Python import path to another URLconf module
+ that should be "included" in this place. Optionally, the :term:`application
+ namespace` and :term:`instance namespace` where the entries will be included
+ into can also be specified.
+
+ Usually, the application namespace should be specified by the included
+ module. If an application namespace is set, the ``namespace`` argument
+ can be used to set a different instance namespace.
+
+ ``include()`` also accepts as an argument either an iterable that returns
+ URL patterns or a 2-tuple containing such iterable plus the names of the
+ application namespaces.
+
+ :arg module: URLconf module (or module name)
+ :arg namespace: Instance namespace for the URL entries being included
+ :type namespace: string
+ :arg pattern_list: Iterable of :func:`django.conf.urls.url` instances
+ :arg app_namespace: Application namespace for the URL entries being included
+ :type app_namespace: string
+ :arg instance_namespace: Instance namespace for the URL entries being included
+ :type instance_namespace: string
+
+See :ref:`including-other-urlconfs` and :ref:`namespaces-and-include`.
+
+.. versionchanged:: 2.0
+
+ In older versions, this function is located in ``django.conf.urls``. The
+ old location still works for backwards compatibility.
+
+==================================================
+``django.conf.urls`` functions for use in URLconfs
+==================================================
.. module:: django.conf.urls
@@ -50,37 +95,6 @@ function or method. See :ref:`views-extra-options` for an example.
See :ref:`Naming URL patterns <naming-url-patterns>` for why the ``name``
parameter is useful.
-``include()``
-=============
-
-.. function:: include(module, namespace=None)
- include(pattern_list)
- include((pattern_list, app_namespace), namespace=None)
-
- A function that takes a full Python import path to another URLconf module
- that should be "included" in this place. Optionally, the :term:`application
- namespace` and :term:`instance namespace` where the entries will be included
- into can also be specified.
-
- Usually, the application namespace should be specified by the included
- module. If an application namespace is set, the ``namespace`` argument
- can be used to set a different instance namespace.
-
- ``include()`` also accepts as an argument either an iterable that returns
- URL patterns or a 2-tuple containing such iterable plus the names of the
- application namespaces.
-
- :arg module: URLconf module (or module name)
- :arg namespace: Instance namespace for the URL entries being included
- :type namespace: string
- :arg pattern_list: Iterable of :func:`django.conf.urls.url` instances
- :arg app_namespace: Application namespace for the URL entries being included
- :type app_namespace: string
- :arg instance_namespace: Instance namespace for the URL entries being included
- :type instance_namespace: string
-
-See :ref:`including-other-urlconfs` and :ref:`namespaces-and-include`.
-
``handler400``
==============