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
d79122f4
Kaydet (Commit)
d79122f4
authored
Agu 17, 2015
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Refs #23276 -- Removed passing views as strings to url() per deprecation timeline.
üst
a25d3ce0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
29 deletions
+3
-29
__init__.py
django/conf/urls/__init__.py
+2
-15
urls.txt
docs/ref/urls.txt
+1
-14
No files found.
django/conf/urls/__init__.py
Dosyayı görüntüle @
d79122f4
...
@@ -6,9 +6,7 @@ from django.core.urlresolvers import (
...
@@ -6,9 +6,7 @@ from django.core.urlresolvers import (
LocaleRegexURLResolver
,
RegexURLPattern
,
RegexURLResolver
,
LocaleRegexURLResolver
,
RegexURLPattern
,
RegexURLResolver
,
)
)
from
django.utils
import
six
from
django.utils
import
six
from
django.utils.deprecation
import
(
from
django.utils.deprecation
import
RemovedInDjango20Warning
RemovedInDjango20Warning
,
RemovedInDjango110Warning
,
)
__all__
=
[
'handler400'
,
'handler403'
,
'handler404'
,
'handler500'
,
'include'
,
'url'
]
__all__
=
[
'handler400'
,
'handler403'
,
'handler404'
,
'handler500'
,
'include'
,
'url'
]
...
@@ -76,21 +74,10 @@ def include(arg, namespace=None, app_name=None):
...
@@ -76,21 +74,10 @@ def include(arg, namespace=None, app_name=None):
return
(
urlconf_module
,
app_name
,
namespace
)
return
(
urlconf_module
,
app_name
,
namespace
)
def
url
(
regex
,
view
,
kwargs
=
None
,
name
=
None
,
prefix
=
''
):
def
url
(
regex
,
view
,
kwargs
=
None
,
name
=
None
):
if
isinstance
(
view
,
(
list
,
tuple
)):
if
isinstance
(
view
,
(
list
,
tuple
)):
# For include(...) processing.
# For include(...) processing.
urlconf_module
,
app_name
,
namespace
=
view
urlconf_module
,
app_name
,
namespace
=
view
return
RegexURLResolver
(
regex
,
urlconf_module
,
kwargs
,
app_name
=
app_name
,
namespace
=
namespace
)
return
RegexURLResolver
(
regex
,
urlconf_module
,
kwargs
,
app_name
=
app_name
,
namespace
=
namespace
)
else
:
else
:
if
isinstance
(
view
,
six
.
string_types
):
warnings
.
warn
(
'Support for string view arguments to url() is deprecated and '
'will be removed in Django 1.10 (got
%
s). Pass the callable '
'instead.'
%
view
,
RemovedInDjango110Warning
,
stacklevel
=
2
)
if
not
view
:
raise
ImproperlyConfigured
(
'Empty URL pattern view name not permitted (for pattern
%
r)'
%
regex
)
if
prefix
:
view
=
prefix
+
'.'
+
view
return
RegexURLPattern
(
regex
,
view
,
kwargs
,
name
)
return
RegexURLPattern
(
regex
,
view
,
kwargs
,
name
)
docs/ref/urls.txt
Dosyayı görüntüle @
d79122f4
...
@@ -26,7 +26,7 @@ Helper function to return a URL pattern for serving files in debug mode::
...
@@ -26,7 +26,7 @@ Helper function to return a URL pattern for serving files in debug mode::
url()
url()
-----
-----
.. function:: url(regex, view, kwargs=None, name=None
, prefix=''
)
.. function:: url(regex, view, kwargs=None, name=None)
``urlpatterns`` should be a list of ``url()`` instances. For example::
``urlpatterns`` should be a list of ``url()`` instances. For example::
...
@@ -35,25 +35,12 @@ url()
...
@@ -35,25 +35,12 @@ url()
...
...
]
]
This function takes five arguments, most of which are optional::
url(regex, view, kwargs=None, name=None, prefix='')
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.
See :ref:`Naming URL patterns <naming-url-patterns>` for why the ``name``
See :ref:`Naming URL patterns <naming-url-patterns>` for why the ``name``
parameter is useful.
parameter is useful.
.. deprecated:: 1.8
Support for string ``view`` arguments is deprecated and will be removed in
Django 1.10. Pass the callable instead.
The ``prefix`` parameter has the same meaning as the first argument to
``patterns()`` and is only relevant when you're passing a string as the
``view`` parameter.
include()
include()
---------
---------
...
...
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