From 2522559d1a612a4e8885de4780ff2b7aa7b8d375 Mon Sep 17 00:00:00 2001 From: David Smith Date: Mon, 4 May 2020 19:33:35 +0100 Subject: Fixed #31534 -- Deprecated django.conf.urls.url(). --- django/conf/urls/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'django/conf/urls/__init__.py') diff --git a/django/conf/urls/__init__.py b/django/conf/urls/__init__.py index 7bda34516b..311cd70b84 100644 --- a/django/conf/urls/__init__.py +++ b/django/conf/urls/__init__.py @@ -1,4 +1,7 @@ +import warnings + from django.urls import include, re_path +from django.utils.deprecation import RemovedInDjango40Warning from django.views import defaults __all__ = ['handler400', 'handler403', 'handler404', 'handler500', 'include', 'url'] @@ -10,4 +13,9 @@ handler500 = defaults.server_error def url(regex, view, kwargs=None, name=None): + warnings.warn( + 'django.conf.urls.url() is deprecated in favor of ' + 'django.urls.re_path().', + RemovedInDjango40Warning, + ) return re_path(regex, view, kwargs, name) -- cgit v1.3