diff --git a/rest_framework/documentation.py b/rest_framework/documentation.py index ce61fa6bf..53e5ab551 100644 --- a/rest_framework/documentation.py +++ b/rest_framework/documentation.py @@ -1,4 +1,4 @@ -from django.conf.urls import include, url +from django.urls import include, path from rest_framework.renderers import ( CoreJSONRenderer, DocumentationRenderer, SchemaJSRenderer @@ -82,7 +82,7 @@ def include_docs_urls( permission_classes=permission_classes, ) urls = [ - url(r'^$', docs_view, name='docs-index'), - url(r'^schema.js$', schema_js_view, name='schema-js') + path('', docs_view, name='docs-index'), + path('schema.js', schema_js_view, name='schema-js') ] return include((urls, 'api-docs'), namespace='api-docs') diff --git a/rest_framework/urlpatterns.py b/rest_framework/urlpatterns.py index 8c29bbc48..bed5708eb 100644 --- a/rest_framework/urlpatterns.py +++ b/rest_framework/urlpatterns.py @@ -1,5 +1,4 @@ -from django.conf.urls import include -from django.urls import URLResolver, path, re_path, register_converter +from django.urls import URLResolver, include, path, re_path, register_converter from django.urls.resolvers import RoutePattern from rest_framework.settings import api_settings