Dear Maintainer,
> > from django.conf.urls import include, url
> E ImportError: cannot import name 'url' from 'django.conf.urls'
> (/usr/lib/python3/dist-packages/django/conf/urls/__init__.py)
Since Django 4.x, url() function was removed and replaced by "re_path". Attached
patch fix the build failure.
Kind regards
--- a/tests/testapp/urls.py
+++ b/tests/testapp/urls.py
@@ -1,5 +1,5 @@
-from django.conf.urls import include, url
+from django.urls import include, re_path
from rest_framework import routers
from . import views
@@ -15,5 +15,5 @@
urlpatterns = [
- url(r'^', include(router.urls)),
+ re_path(r'^', include(router.urls)),
]
--- a/tests/perf/urls.py
+++ b/tests/perf/urls.py
@@ -1,5 +1,5 @@
-from django.conf.urls import include, url
+from django.urls import include, re_path
from rest_framework import routers
from . import views
@@ -10,5 +10,5 @@
urlpatterns = [
- url(r'^', include(router.urls)),
+ re_path(r'^', include(router.urls)),
]