Repository: littlepea/django-docs (language: python)

Issue:
django.conf.urls.url() is deprecated in favor of django.urls.re_path()



Discussion / hints:

Fix patch:
diff --git a/docs/urls.py b/docs/urls.py
index 50e9bb0..9623db3 100644
--- a/docs/urls.py
+++ b/docs/urls.py
@@ -1,13 +1,13 @@
-from django.conf.urls import url
+from django.conf.urls import re_path
 from docs.views import DocsRootView, serve_docs, DOCS_DIRHTML
 
 urlpatterns = []
 
 if not DOCS_DIRHTML:
     urlpatterns += [
-        url(r'^$', DocsRootView.as_view(permanent=True), name='docs_root'),
+        re_path(r'^$', DocsRootView.as_view(permanent=True), name='docs_root'),
     ]
 
 urlpatterns += [
-    url(r"^(?P<path>.*)$", serve_docs, name="docs_files"),
+    re_path(r"^(?P<path>.*)$", serve_docs, name="docs_files"),
 ]


Test patch:
diff --git a/docs/tests/urls.py b/docs/tests/urls.py
index efb5571..b1a1d5d 100644
--- a/docs/tests/urls.py
+++ b/docs/tests/urls.py
@@ -4,9 +4,9 @@
 you can actually reach the app's views (provided it has any views, of course).
 
 """
-from django.conf.urls import include, url
+from django.conf.urls import include, re_path
 
 
 urlpatterns = [
-    url(r'^', include('docs.urls')),
+    re_path(r'^', include('docs.urls')),
 ]