Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
d06014db
Kaydet (Commit)
d06014db
authored
Eyl 05, 2015
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Removed some discussion of deprecated {% url %} behavior.
üst
5528e7da
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
15 deletions
+10
-15
builtins.txt
docs/ref/templates/builtins.txt
+10
-15
No files found.
docs/ref/templates/builtins.txt
Dosyayı görüntüle @
d06014db
...
...
@@ -1031,18 +1031,17 @@ url
^^^
Returns an absolute path reference (a URL without the domain name) matching a
given view
function and optional parameters. Any special characters in the
resulting
path will be encoded using :func:`~django.utils.encoding.iri_to_uri`.
given view
and optional parameters. Any special characters in the resulting
path will be encoded using :func:`~django.utils.encoding.iri_to_uri`.
This is a way to output links without violating the DRY principle by having to
hard-code URLs in your templates::
{% url 'some-url-name' v1 v2 %}
The first argument is a path to a view function in the format
``package.package.module.function``. 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 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::
...
...
@@ -1057,7 +1056,7 @@ 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')
('^client/([0-9]+)/$',
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:
...
...
@@ -1072,10 +1071,6 @@ such as this:
The template tag will output the string ``/clients/client/123/``.
If you're using :ref:`named URL patterns <naming-url-patterns>`, you can
refer to the name of the pattern in the ``url`` tag instead of using the
path to the view.
Note that if the URL you're reversing doesn't exist, you'll get an
:exc:`~django.core.urlresolvers.NoReverseMatch` exception raised, which will
cause your site to display an error page.
...
...
@@ -1108,15 +1103,15 @@ by the context as to the current application.
.. deprecated:: 1.8
The dotted Python path syntax is deprecated and will be removed in
Django 1.10::
You can also pass a dotted Python path to a view function, but this syntax
is deprecated and will be removed in
Django 1.10::
{% url 'path.to.some_view' v1 v2 %}
.. warning::
Don't forget to put quotes around the
function path or pattern name,
otherwise the value will be interpreted as a context variable!
Don't forget to put quotes around the
:func:`~django.conf.urls.url`
``name``,
otherwise the value will be interpreted as a context variable!
.. templatetag:: verbatim
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment