summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Nester <andrew.nester.dev@gmail.com>2016-06-20 12:07:59 +0300
committerTim Graham <timograham@gmail.com>2016-06-20 11:57:58 -0400
commit7a3cc2957f0220dc75cc5790ac72e884b682cc65 (patch)
tree0645527b35d6f87934fc3c1978c22ee9ca4b05a2
parent44eaa2dac84ed06d5179edf56224cc604d8b4879 (diff)
[1.10.x] Fixed #26776 -- Documented url()'s view argument.
Backport of a12826bba7a6d75862f99ae5cd48c4c1854208b8 from master
-rw-r--r--docs/ref/urls.txt9
1 files changed, 8 insertions, 1 deletions
diff --git a/docs/ref/urls.txt b/docs/ref/urls.txt
index 6bf8c1effe..37df9a30cf 100644
--- a/docs/ref/urls.txt
+++ b/docs/ref/urls.txt
@@ -25,11 +25,18 @@ Helper function to return a URL pattern for serving files in debug mode::
``urlpatterns`` should be a list of ``url()`` instances. For example::
+ from django.conf.urls import include, url
+
urlpatterns = [
- url(r'^index/$', index_view, name="main-view"),
+ url(r'^index/$', index_view, name='main-view'),
+ url(r'^weblog/', include('blog.urls')),
...
]
+The ``view`` parameter is a view function or the result of
+:meth:`~django.views.generic.base.View.as_view` for class-based views. It can
+also be an :func:`include`.
+
The ``kwargs`` parameter allows you to pass additional arguments to the view
function or method. See :ref:`views-extra-options` for an example.