summaryrefslogtreecommitdiff
path: root/docs/releases
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2014-08-12 10:54:42 -0400
committerTim Graham <timograham@gmail.com>2014-08-12 13:15:40 -0400
commita9fd740d22bc4fed5fdb280c036618000ee13df1 (patch)
tree18a58170b4633f22e5869db2c2ed086245ed415c /docs/releases
parent2003cb23d4f1b3be717855d41b562d4d5cfebe99 (diff)
Fixed #23276 -- Deprecated passing views as strings to url().
Diffstat (limited to 'docs/releases')
-rw-r--r--docs/releases/1.8.txt13
1 files changed, 11 insertions, 2 deletions
diff --git a/docs/releases/1.8.txt b/docs/releases/1.8.txt
index e391b6de11..318b6ce49f 100644
--- a/docs/releases/1.8.txt
+++ b/docs/releases/1.8.txt
@@ -548,6 +548,13 @@ Updating your code is as simple as ensuring that ``urlpatterns`` is a list of
url('^other/$', views.otherview),
]
+Passing a string as ``view`` to :func:`~django.conf.urls.url`
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Related to the previous item, referencing views as strings in the ``url()``
+function is deprecated. Pass the callable view as described in the previous
+section instead.
+
``django.test.SimpleTestCase.urls``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -580,8 +587,10 @@ for reversing instead.
If you are using :mod:`django.contrib.sitemaps`, add the ``name`` argument to
the ``url`` that references :func:`django.contrib.sitemaps.views.sitemap`::
- url(r'^sitemap\.xml$', 'django.contrib.sitemaps.views.sitemap',
- {'sitemaps': sitemaps}, name='django.contrib.sitemaps.views.sitemap')
+ from django.contrib.sitemaps.views import sitemap
+
+ url(r'^sitemap\.xml$', sitemap, {'sitemaps': sitemaps},
+ name='django.contrib.sitemaps.views.sitemap')
to ensure compatibility when reversing by Python path is removed in Django 2.0.