mirror of
https://github.com/django/django.git
synced 2025-06-05 11:39:13 +00:00
Fixed #26776 -- Documented url()'s view argument.
This commit is contained in:
parent
17e661641d
commit
a12826bba7
@ -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::
|
``urlpatterns`` should be a list of ``url()`` instances. For example::
|
||||||
|
|
||||||
|
from django.conf.urls import include, url
|
||||||
|
|
||||||
urlpatterns = [
|
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
|
The ``kwargs`` parameter allows you to pass additional arguments to the view
|
||||||
function or method. See :ref:`views-extra-options` for an example.
|
function or method. See :ref:`views-extra-options` for an example.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user