diff options
Diffstat (limited to 'docs/ref/templates')
| -rw-r--r-- | docs/ref/templates/builtins.txt | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt index c4ad02f529..49e07aeec2 100644 --- a/docs/ref/templates/builtins.txt +++ b/docs/ref/templates/builtins.txt @@ -1115,11 +1115,11 @@ hard-code URLs in your templates:: {% url 'some-url-name' v1 v2 %} -The first argument is a :func:`~django.conf.urls.url` ``name``. It can be a -quoted literal or any other context variable. Additional arguments are optional -and should be space-separated values that will be used as arguments in the URL. -The example above shows passing positional arguments. Alternatively you may -use keyword syntax:: +The first argument is a :ref:`URL pattern name <naming-url-patterns>`. It can +be a quoted literal or any other context variable. Additional arguments are +optional and should be space-separated values that will be used as arguments in +the URL. The example above shows passing positional arguments. Alternatively +you may use keyword syntax:: {% url 'some-url-name' arg1=v1 arg2=v2 %} @@ -1132,14 +1132,14 @@ takes a client ID (here, ``client()`` is a method inside the views file .. code-block:: python - ('^client/([0-9]+)/$', app_views.client, name='app-views-client') + path('client/<int:id>/', app_views.client, name='app-views-client') If this app's URLconf is included into the project's URLconf under a path such as this: .. code-block:: python - ('^clients/', include('project_name.app_name.urls')) + path('clients/', include('project_name.app_name.urls')) ...then, in a template, you can create a link to this view like this:: @@ -1179,8 +1179,8 @@ by the context as to the current application. .. warning:: - Don't forget to put quotes around the :func:`~django.conf.urls.url` - ``name``, otherwise the value will be interpreted as a context variable! + Don't forget to put quotes around the URL pattern ``name``, otherwise the + value will be interpreted as a context variable! .. templatetag:: verbatim |
