Permalink
Browse files

Fixed #22218 -- Deprecated django.conf.urls.patterns.

Thanks Carl Meyer for the suggestion and Alex Gaynor and Carl for reviews.
  • Loading branch information...
1 parent e6ced2b commit d73d0e071c1b4c86d57994a0ab55a74cfe80cdf5 @timgraham timgraham committed Apr 2, 2014
Showing with 1,183 additions and 1,102 deletions.
  1. +3 −3 django/conf/project_template/project_name/urls.py
  2. +8 −0 django/conf/urls/__init__.py
  3. +17 −4 django/conf/urls/i18n.py
  4. +5 −5 django/conf/urls/static.py
  5. +3 −3 django/contrib/admin/options.py
  6. +11 −11 django/contrib/admin/sites.py
  7. +3 −3 django/contrib/admindocs/urls.py
  8. +4 −5 django/contrib/auth/admin.py
  9. +27 −27 django/contrib/auth/tests/urls.py
  10. +4 −4 django/contrib/auth/tests/urls_admin.py
  11. +12 −12 django/contrib/auth/urls.py
  12. +5 −5 django/contrib/flatpages/tests/urls.py
  13. +5 −4 django/contrib/flatpages/urls.py
  14. +3 −3 django/contrib/formtools/tests/urls.py
  15. +3 −3 django/contrib/formtools/tests/wizard/namedwizardtests/urls.py
  16. +3 −3 django/contrib/formtools/tests/wizard/wizardtests/urls.py
  17. +4 −4 django/contrib/gis/tests/geoadmin/urls.py
  18. +14 −11 django/contrib/gis/tests/geoapp/urls.py
  19. +7 −7 django/contrib/messages/tests/urls.py
  20. +14 −13 django/contrib/sitemaps/tests/urls/http.py
  21. +6 −5 django/contrib/sitemaps/tests/urls/https.py
  22. +4 −4 docs/howto/static-files/index.txt
  23. +5 −0 docs/internals/deprecation.txt
  24. +6 −6 docs/intro/overview.txt
  25. +12 −12 docs/intro/tutorial03.txt
  26. +3 −3 docs/intro/tutorial04.txt
  27. +9 −10 docs/ref/class-based-views/base.txt
  28. +21 −21 docs/ref/class-based-views/generic-date-based.txt
  29. +6 −6 docs/ref/class-based-views/generic-display.txt
  30. +3 −3 docs/ref/class-based-views/index.txt
  31. +19 −19 docs/ref/contrib/admin/index.txt
  32. +17 −13 docs/ref/contrib/flatpages.txt
  33. +14 −14 docs/ref/contrib/formtools/form-wizard.txt
  34. +3 −3 docs/ref/contrib/gis/tutorial.txt
  35. +21 −17 docs/ref/contrib/sitemaps.txt
  36. +4 −3 docs/ref/contrib/staticfiles.txt
  37. +9 −9 docs/ref/contrib/syndication.txt
  38. +39 −10 docs/ref/urls.txt
  39. +4 −3 docs/ref/views.txt
  40. +59 −0 docs/releases/1.8.txt
  41. +1 −0 docs/spelling_wordlist
  42. +9 −9 docs/topics/cache.txt
  43. +10 −10 docs/topics/class-based-views/generic-display.txt
  44. +3 −3 docs/topics/class-based-views/generic-editing.txt
  45. +12 −12 docs/topics/class-based-views/index.txt
  46. +11 −11 docs/topics/class-based-views/intro.txt
  47. +3 −3 docs/topics/class-based-views/mixins.txt
  48. +99 −163 docs/topics/http/urls.txt
  49. +27 −20 docs/topics/i18n/translation.txt
  50. +4 −4 tests/admin_changelist/urls.py
  51. +3 −3 tests/admin_custom_urls/models.py
  52. +4 −4 tests/admin_custom_urls/urls.py
  53. +10 −10 tests/admin_docs/urls.py
  54. +4 −4 tests/admin_inlines/urls.py
  55. +5 −6 tests/admin_scripts/urls.py
  56. +3 −3 tests/admin_views/admin.py
  57. +4 −4 tests/admin_views/customadmin.py
  58. +10 −10 tests/admin_views/urls.py
  59. +4 −4 tests/admin_widgets/urls.py
  60. +8 −8 tests/conditional_processing/urls.py
  61. +5 −4 tests/contenttypes_tests/urls.py
  62. +4 −4 tests/context_processors/urls.py
  63. +3 −3 tests/file_storage/urls.py
  64. +14 −14 tests/file_uploads/urls.py
  65. +3 −3 tests/forms_tests/urls.py
  66. +4 −4 tests/generic_inline_admin/urls.py
  67. +107 −111 tests/generic_views/urls.py
  68. +3 −3 tests/handlers/urls.py
  69. +4 −4 tests/i18n/patterns/urls/default.py
  70. +1 −1 tests/i18n/patterns/urls/disabled.py
  71. +3 −3 tests/i18n/patterns/urls/included.py
  72. +3 −3 tests/i18n/patterns/urls/namespace.py
  73. +2 −3 tests/i18n/patterns/urls/path_unused.py
  74. +1 −1 tests/i18n/patterns/urls/wrong.py
  75. +1 −1 tests/i18n/patterns/urls/wrong_namespace.py
  76. +11 −4 tests/i18n/urls.py
  77. +3 −3 tests/logging_tests/urls.py
  78. +4 −4 tests/middleware/cond_get_urls.py
  79. +6 −6 tests/middleware/extra_urls.py
  80. +6 −6 tests/middleware/urls.py
  81. +10 −10 tests/middleware_exceptions/urls.py
  82. +3 −3 tests/model_permalink/urls.py
  83. +4 −4 tests/proxy_models/urls.py
  84. +5 −5 tests/resolve_url/urls.py
  85. +3 −3 tests/servers/urls.py
  86. +5 −4 tests/staticfiles_tests/urls/default.py
  87. +18 −18 tests/syndication_tests/urls.py
  88. +4 −4 tests/template_tests/alternate_urls.py
  89. +7 −8 tests/template_tests/urls.py
  90. +31 −31 tests/test_client/urls.py
  91. +32 −32 tests/test_client_regress/urls.py
  92. +3 −3 tests/test_utils/tests.py
  93. +5 −5 tests/test_utils/urls.py
  94. +4 −4 tests/timezones/urls.py
  95. +3 −3 tests/urlpatterns_reverse/erroneous_urls.py
  96. +3 −3 tests/urlpatterns_reverse/extra_urls.py
  97. +4 −4 tests/urlpatterns_reverse/included_named_urls.py
  98. +3 −3 tests/urlpatterns_reverse/included_named_urls2.py
  99. +17 −11 tests/urlpatterns_reverse/included_namespace_urls.py
  100. +3 −3 tests/urlpatterns_reverse/included_no_kwargs_urls.py
  101. +3 −3 tests/urlpatterns_reverse/included_urls.py
  102. +3 −3 tests/urlpatterns_reverse/included_urls2.py
  103. +4 −4 tests/urlpatterns_reverse/named_urls.py
  104. +26 −26 tests/urlpatterns_reverse/namespace_urls.py
  105. +3 −3 tests/urlpatterns_reverse/reverse_lazy_urls.py
  106. +3 −3 tests/urlpatterns_reverse/urlconf_inner.py
  107. +3 −3 tests/urlpatterns_reverse/urlconf_outer.py
  108. +59 −53 tests/urlpatterns_reverse/urls.py
  109. +1 −3 tests/urlpatterns_reverse/urls_error_handlers.py
  110. +1 −3 tests/urlpatterns_reverse/urls_error_handlers_callables.py
  111. +3 −3 tests/urlpatterns_reverse/urls_without_full_import.py
  112. +1 −2 tests/urls.py
  113. +3 −3 tests/view_tests/default_urls.py
  114. +27 −27 tests/view_tests/generic_urls.py
  115. +3 −3 tests/view_tests/regression_21530_urls.py
  116. +28 −27 tests/view_tests/urls.py
  117. +4 −5 tests/wsgi/urls.py
@@ -1,10 +1,10 @@
-from django.conf.urls import patterns, include, url
+from django.conf.urls import include, url
from django.contrib import admin
-urlpatterns = patterns('',
+urlpatterns = [
# Examples:
# url(r'^$', '{{ project_name }}.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
-)
+]
@@ -1,9 +1,11 @@
from importlib import import_module
+import warnings
from django.core.urlresolvers import (RegexURLPattern,
RegexURLResolver, LocaleRegexURLResolver)
from django.core.exceptions import ImproperlyConfigured
from django.utils import six
+from django.utils.deprecation import RemovedInDjango20Warning
__all__ = ['handler400', 'handler403', 'handler404', 'handler500', 'include', 'patterns', 'url']
@@ -42,6 +44,12 @@ def include(arg, namespace=None, app_name=None):
def patterns(prefix, *args):
+ warnings.warn(
+ 'django.conf.urls.patterns() is deprecated and will be removed in '
+ 'Django 2.0. Update your urlpatterns to be a list of '
+ 'django.conf.urls.url() instances instead.',
+ RemovedInDjango20Warning, stacklevel=2
+ )
pattern_list = []
for t in args:
if isinstance(t, (list, tuple)):
View
@@ -1,21 +1,34 @@
+import warnings
+
from django.conf import settings
from django.conf.urls import patterns, url
from django.core.urlresolvers import LocaleRegexURLResolver
+from django.utils import six
+from django.utils.deprecation import RemovedInDjango20Warning
def i18n_patterns(prefix, *args):
"""
Adds the language code prefix to every URL pattern within this
function. This may only be used in the root URLconf, not in an included
URLconf.
-
"""
- pattern_list = patterns(prefix, *args)
+ if isinstance(prefix, (six.text_type, str)):
+ warnings.warn(
+ "Calling i18n_patterns() with the `prefix` argument and with tuples "
+ "instead of django.conf.urls.url() instances is deprecated and "
+ "will no longer work in Django 2.0. Use a list of "
+ "django.conf.urls.url() instances instead.",
+ RemovedInDjango20Warning, stacklevel=2
+ )
+ pattern_list = patterns(prefix, *args)
+ else:
+ pattern_list = [prefix] + list(args)
if not settings.USE_I18N:
return pattern_list
return [LocaleRegexURLResolver(pattern_list)]
-urlpatterns = patterns('',
+urlpatterns = [
url(r'^setlang/$', 'django.views.i18n.set_language', name='set_language'),
-)
+]
View
@@ -1,7 +1,7 @@
import re
from django.conf import settings
-from django.conf.urls import patterns, url
+from django.conf.urls import url
from django.core.exceptions import ImproperlyConfigured
@@ -12,16 +12,16 @@ def static(prefix, view='django.views.static.serve', **kwargs):
from django.conf import settings
from django.conf.urls.static import static
- urlpatterns = patterns('',
+ urlpatterns = [
# ... the rest of your URLconf goes here ...
- ) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
+ ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
"""
# No-op if not in debug mode or an non-local prefix
if not settings.DEBUG or (prefix and '://' in prefix):
return []
elif not prefix:
raise ImproperlyConfigured("Empty static prefix not permitted")
- return patterns('',
+ return [
url(r'^%s(?P<path>.*)$' % re.escape(prefix.lstrip('/')), view, kwargs=kwargs),
- )
+ ]
@@ -543,7 +543,7 @@ def get_inline_instances(self, request, obj=None):
return inline_instances
def get_urls(self):
- from django.conf.urls import patterns, url
+ from django.conf.urls import url
def wrap(view):
def wrapper(*args, **kwargs):
@@ -552,13 +552,13 @@ def wrapper(*args, **kwargs):
info = self.model._meta.app_label, self.model._meta.model_name
- urlpatterns = patterns('',
+ urlpatterns = [
url(r'^$', wrap(self.changelist_view), name='%s_%s_changelist' % info),
url(r'^add/$', wrap(self.add_view), name='%s_%s_add' % info),
url(r'^(.+)/history/$', wrap(self.history_view), name='%s_%s_history' % info),
url(r'^(.+)/delete/$', wrap(self.delete_view), name='%s_%s_delete' % info),
url(r'^(.+)/$', wrap(self.change_view), name='%s_%s_change' % info),
- )
+ ]
return urlpatterns
def urls(self):
@@ -177,12 +177,12 @@ def admin_view(self, view, cacheable=False):
class MyAdminSite(AdminSite):
def get_urls(self):
- from django.conf.urls import patterns, url
+ from django.conf.urls import url
urls = super(MyAdminSite, self).get_urls()
- urls += patterns('',
+ urls += [
url(r'^my_view/$', self.admin_view(some_view))
- )
+ ]
return urls
By default, admin_views are marked non-cacheable using the
@@ -211,7 +211,7 @@ def inner(request, *args, **kwargs):
return update_wrapper(inner, view)
def get_urls(self):
- from django.conf.urls import patterns, url, include
+ from django.conf.urls import url, include
# Since this module gets imported in the application's root package,
# it cannot import models from other applications at the module level,
# and django.contrib.contenttypes.views imports ContentType.
@@ -226,33 +226,33 @@ def wrapper(*args, **kwargs):
return update_wrapper(wrapper, view)
# Admin-site-wide views.
- urlpatterns = patterns('',
+ urlpatterns = [
url(r'^$', wrap(self.index), name='index'),
url(r'^login/$', self.login, name='login'),
url(r'^logout/$', wrap(self.logout), name='logout'),
url(r'^password_change/$', wrap(self.password_change, cacheable=True), name='password_change'),
url(r'^password_change/done/$', wrap(self.password_change_done, cacheable=True), name='password_change_done'),
url(r'^jsi18n/$', wrap(self.i18n_javascript, cacheable=True), name='jsi18n'),
url(r'^r/(?P<content_type_id>\d+)/(?P<object_id>.+)/$', wrap(contenttype_views.shortcut), name='view_on_site'),
- )
+ ]
# Add in each model's views, and create a list of valid URLS for the
# app_index
valid_app_labels = []
for model, model_admin in six.iteritems(self._registry):
- urlpatterns += patterns('',
- url(r'^%s/%s/' % (model._meta.app_label, model._meta.model_name), include(model_admin.urls))
- )
+ urlpatterns += [
+ url(r'^%s/%s/' % (model._meta.app_label, model._meta.model_name), include(model_admin.urls)),
+ ]
if model._meta.app_label not in valid_app_labels:
valid_app_labels.append(model._meta.app_label)
# If there were ModelAdmins registered, we should have a list of app
# labels for which we need to allow access to the app_index view,
if valid_app_labels:
regex = r'^(?P<app_label>' + '|'.join(valid_app_labels) + ')/$'
- urlpatterns += patterns('',
+ urlpatterns += [
url(regex, wrap(self.app_index), name='app_list'),
- )
+ ]
return urlpatterns
@property
@@ -1,7 +1,7 @@
-from django.conf.urls import patterns, url
+from django.conf.urls import url
from django.contrib.admindocs import views
-urlpatterns = patterns('',
+urlpatterns = [
url('^$',
views.BaseAdminDocsView.as_view(template_name='admin_doc/index.html'),
name='django-admindocs-docroot'),
@@ -29,4 +29,4 @@
url('^templates/(?P<template>.*)/$',
views.TemplateDetailView.as_view(),
name='django-admindocs-templates'),
-)
+]
@@ -1,5 +1,6 @@
from django.db import transaction
from django.conf import settings
+from django.conf.urls import url
from django.contrib import admin
from django.contrib.admin.options import IS_POPUP_VAR
from django.contrib.auth.forms import (UserCreationForm, UserChangeForm,
@@ -76,11 +77,9 @@ def get_form(self, request, obj=None, **kwargs):
return super(UserAdmin, self).get_form(request, obj, **defaults)
def get_urls(self):
- from django.conf.urls import patterns
- return patterns('',
- (r'^(\d+)/password/$',
- self.admin_site.admin_view(self.user_change_password))
- ) + super(UserAdmin, self).get_urls()
+ return [
+ url(r'^(\d+)/password/$', self.admin_site.admin_view(self.user_change_password)),
+ ] + super(UserAdmin, self).get_urls()
def lookup_allowed(self, lookup, value):
# See #20078: we don't want to allow any lookups involving passwords.
@@ -1,4 +1,4 @@
-from django.conf.urls import patterns, url, include
+from django.conf.urls import url, include
from django.contrib import admin
from django.contrib.auth import context_processors
from django.contrib.auth.forms import AuthenticationForm
@@ -70,36 +70,36 @@ def custom_request_auth_login(request):
return login(request, authentication_form=CustomRequestAuthenticationForm)
# special urls for auth test cases
-urlpatterns = urlpatterns + patterns('',
- (r'^logout/custom_query/$', 'django.contrib.auth.views.logout', dict(redirect_field_name='follow')),
- (r'^logout/next_page/$', 'django.contrib.auth.views.logout', dict(next_page='/somewhere/')),
- (r'^logout/next_page/named/$', 'django.contrib.auth.views.logout', dict(next_page='password_reset')),
- (r'^remote_user/$', remote_user_auth_view),
- (r'^password_reset_from_email/$', 'django.contrib.auth.views.password_reset', dict(from_email='staffmember@example.com')),
- (r'^password_reset/custom_redirect/$', 'django.contrib.auth.views.password_reset', dict(post_reset_redirect='/custom/')),
- (r'^password_reset/custom_redirect/named/$', 'django.contrib.auth.views.password_reset', dict(post_reset_redirect='password_reset')),
- (r'^password_reset/html_email_template/$', 'django.contrib.auth.views.password_reset', dict(html_email_template_name='registration/html_password_reset_email.html')),
- (r'^reset/custom/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
+urlpatterns += [
+ url(r'^logout/custom_query/$', 'django.contrib.auth.views.logout', dict(redirect_field_name='follow')),
+ url(r'^logout/next_page/$', 'django.contrib.auth.views.logout', dict(next_page='/somewhere/')),
+ url(r'^logout/next_page/named/$', 'django.contrib.auth.views.logout', dict(next_page='password_reset')),
+ url(r'^remote_user/$', remote_user_auth_view),
+ url(r'^password_reset_from_email/$', 'django.contrib.auth.views.password_reset', dict(from_email='staffmember@example.com')),
+ url(r'^password_reset/custom_redirect/$', 'django.contrib.auth.views.password_reset', dict(post_reset_redirect='/custom/')),
+ url(r'^password_reset/custom_redirect/named/$', 'django.contrib.auth.views.password_reset', dict(post_reset_redirect='password_reset')),
+ url(r'^password_reset/html_email_template/$', 'django.contrib.auth.views.password_reset', dict(html_email_template_name='registration/html_password_reset_email.html')),
+ url(r'^reset/custom/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
'django.contrib.auth.views.password_reset_confirm',
dict(post_reset_redirect='/custom/')),
- (r'^reset/custom/named/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
+ url(r'^reset/custom/named/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
'django.contrib.auth.views.password_reset_confirm',
dict(post_reset_redirect='password_reset')),
- (r'^password_change/custom/$', 'django.contrib.auth.views.password_change', dict(post_change_redirect='/custom/')),
- (r'^password_change/custom/named/$', 'django.contrib.auth.views.password_change', dict(post_change_redirect='password_reset')),
- (r'^admin_password_reset/$', 'django.contrib.auth.views.password_reset', dict(is_admin_site=True)),
- (r'^login_required/$', login_required(password_reset)),
- (r'^login_required_login_url/$', login_required(password_reset, login_url='/somewhere/')),
-
- (r'^auth_processor_no_attr_access/$', auth_processor_no_attr_access),
- (r'^auth_processor_attr_access/$', auth_processor_attr_access),
- (r'^auth_processor_user/$', auth_processor_user),
- (r'^auth_processor_perms/$', auth_processor_perms),
- (r'^auth_processor_perm_in_perms/$', auth_processor_perm_in_perms),
- (r'^auth_processor_messages/$', auth_processor_messages),
- (r'^custom_request_auth_login/$', custom_request_auth_login),
+ url(r'^password_change/custom/$', 'django.contrib.auth.views.password_change', dict(post_change_redirect='/custom/')),
+ url(r'^password_change/custom/named/$', 'django.contrib.auth.views.password_change', dict(post_change_redirect='password_reset')),
+ url(r'^admin_password_reset/$', 'django.contrib.auth.views.password_reset', dict(is_admin_site=True)),
+ url(r'^login_required/$', login_required(password_reset)),
+ url(r'^login_required_login_url/$', login_required(password_reset, login_url='/somewhere/')),
+
+ url(r'^auth_processor_no_attr_access/$', auth_processor_no_attr_access),
+ url(r'^auth_processor_attr_access/$', auth_processor_attr_access),
+ url(r'^auth_processor_user/$', auth_processor_user),
+ url(r'^auth_processor_perms/$', auth_processor_perms),
+ url(r'^auth_processor_perm_in_perms/$', auth_processor_perm_in_perms),
+ url(r'^auth_processor_messages/$', auth_processor_messages),
+ url(r'^custom_request_auth_login/$', custom_request_auth_login),
url(r'^userpage/(.+)/$', userpage, name="userpage"),
# This line is only required to render the password reset with is_admin=True
- (r'^admin/', include(admin.site.urls)),
-)
+ url(r'^admin/', include(admin.site.urls)),
+]
@@ -2,7 +2,7 @@
Test URLs for auth admins.
"""
-from django.conf.urls import patterns, include
+from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin, GroupAdmin
from django.contrib.auth.models import User, Group
@@ -13,6 +13,6 @@
site.register(User, UserAdmin)
site.register(Group, GroupAdmin)
-urlpatterns = urlpatterns + patterns('',
- (r'^admin/', include(site.urls)),
-)
+urlpatterns += [
+ url(r'^admin/', include(site.urls)),
+]
@@ -3,17 +3,17 @@
# It is also provided as a convenience to those who want to deploy these URLs
# elsewhere.
-from django.conf.urls import patterns, url
+from django.conf.urls import url
+from django.contrib.auth import views
-urlpatterns = patterns('',
- url(r'^login/$', 'django.contrib.auth.views.login', name='login'),
- url(r'^logout/$', 'django.contrib.auth.views.logout', name='logout'),
- url(r'^password_change/$', 'django.contrib.auth.views.password_change', name='password_change'),
- url(r'^password_change/done/$', 'django.contrib.auth.views.password_change_done', name='password_change_done'),
- url(r'^password_reset/$', 'django.contrib.auth.views.password_reset', name='password_reset'),
- url(r'^password_reset/done/$', 'django.contrib.auth.views.password_reset_done', name='password_reset_done'),
+urlpatterns = [
+ url(r'^login/$', views.login, name='login'),
+ url(r'^logout/$', views.logout, name='logout'),
+ url(r'^password_change/$', views.password_change, name='password_change'),
+ url(r'^password_change/done/$', views.password_change_done, name='password_change_done'),
+ url(r'^password_reset/$', views.password_reset, name='password_reset'),
+ url(r'^password_reset/done/$', views.password_reset_done, name='password_reset_done'),
url(r'^reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
- 'django.contrib.auth.views.password_reset_confirm',
- name='password_reset_confirm'),
- url(r'^reset/done/$', 'django.contrib.auth.views.password_reset_complete', name='password_reset_complete'),
-)
+ views.password_reset_confirm, name='password_reset_confirm'),
+ url(r'^reset/done/$', views.password_reset_complete, name='password_reset_complete'),
+]
@@ -1,7 +1,7 @@
-from django.conf.urls import patterns, include
+from django.conf.urls import include, url
# special urls for flatpage test cases
-urlpatterns = patterns('',
- (r'^flatpage_root', include('django.contrib.flatpages.urls')),
- (r'^accounts/', include('django.contrib.auth.urls')),
-)
+urlpatterns = [
+ url(r'^flatpage_root', include('django.contrib.flatpages.urls')),
+ url(r'^accounts/', include('django.contrib.auth.urls')),
+]
@@ -1,5 +1,6 @@
-from django.conf.urls import patterns
+from django.conf.urls import url
+from django.contrib.flatpages import views
-urlpatterns = patterns('django.contrib.flatpages.views',
- (r'^(?P<url>.*)$', 'flatpage'),
-)
+urlpatterns = [
+ url(r'^(?P<url>.*)$', views.flatpage),
+]
@@ -2,12 +2,12 @@
This is a URLconf to be loaded by tests.py. Add any URLs needed for tests only.
"""
-from django.conf.urls import patterns, url
+from django.conf.urls import url
from django.contrib.formtools.tests.tests import TestFormPreview
from django.contrib.formtools.tests.forms import TestForm
-urlpatterns = patterns('',
+urlpatterns = [
url(r'^preview/', TestFormPreview(TestForm)),
-)
+]
Oops, something went wrong.

0 comments on commit d73d0e0

Please sign in to comment.