summaryrefslogtreecommitdiff
path: root/django/conf/urls/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/conf/urls/__init__.py')
-rw-r--r--django/conf/urls/__init__.py11
1 files changed, 2 insertions, 9 deletions
diff --git a/django/conf/urls/__init__.py b/django/conf/urls/__init__.py
index b7ad156122..7bda34516b 100644
--- a/django/conf/urls/__init__.py
+++ b/django/conf/urls/__init__.py
@@ -1,4 +1,4 @@
-from django.urls import RegexURLPattern, RegexURLResolver, include
+from django.urls import include, re_path
from django.views import defaults
__all__ = ['handler400', 'handler403', 'handler404', 'handler500', 'include', 'url']
@@ -10,11 +10,4 @@ handler500 = defaults.server_error
def url(regex, view, kwargs=None, name=None):
- if isinstance(view, (list, tuple)):
- # For include(...) processing.
- urlconf_module, app_name, namespace = view
- return RegexURLResolver(regex, urlconf_module, kwargs, app_name=app_name, namespace=namespace)
- elif callable(view):
- return RegexURLPattern(regex, view, kwargs, name)
- else:
- raise TypeError('view must be a callable or a list/tuple in the case of include().')
+ return re_path(regex, view, kwargs, name)