From a908aa54a67bc9889f302c150a80f6c6a41f1657 Mon Sep 17 00:00:00 2001 From: Ash882 Date: Thu, 9 May 2024 15:40:22 +0200 Subject: [PATCH] Replace url() with re_path() in the docs url() is deprecated and has been removed in Django v4 --- docs/source/adjustment.rst | 2 +- docs/source/authentication_backends.rst | 8 ++++---- docs/source/getting_started.rst | 2 +- docs/source/social_endpoints.rst | 2 +- docs/source/webauthn.rst | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/source/adjustment.rst b/docs/source/adjustment.rst index d76c19a9..3c7b545c 100644 --- a/docs/source/adjustment.rst +++ b/docs/source/adjustment.rst @@ -12,7 +12,7 @@ Define custom ``urls`` instead of reusing ``djoser.urls``: urlpatterns = patterns('', (...), - url(r'^register/$', views.CustomRegistrationView.as_view()), + re_path(r'^register/$', views.CustomRegistrationView.as_view()), ) Define custom view/serializer (inherit from one of ``djoser`` class) and override necessary method/field: diff --git a/docs/source/authentication_backends.rst b/docs/source/authentication_backends.rst index 50bfe691..ac7e610f 100644 --- a/docs/source/authentication_backends.rst +++ b/docs/source/authentication_backends.rst @@ -30,8 +30,8 @@ Configure ``urls.py``. Pay attention to ``djoser.url.authtoken`` module path: urlpatterns = [ (...), - url(r'^auth/', include('djoser.urls')), - url(r'^auth/', include('djoser.urls.authtoken')), + re_path(r'^auth/', include('djoser.urls')), + re_path(r'^auth/', include('djoser.urls.authtoken')), ] Add ``rest_framework.authentication.TokenAuthentication`` to Django REST Framework @@ -89,6 +89,6 @@ Configure ``urls.py`` with ``djoser.url.jwt`` module path: urlpatterns = [ (...), - url(r'^auth/', include('djoser.urls')), - url(r'^auth/', include('djoser.urls.jwt')), + re_path(r'^auth/', include('djoser.urls')), + re_path(r'^auth/', include('djoser.urls.jwt')), ] diff --git a/docs/source/getting_started.rst b/docs/source/getting_started.rst index c10e8bf2..d95ea77e 100644 --- a/docs/source/getting_started.rst +++ b/docs/source/getting_started.rst @@ -76,7 +76,7 @@ Configure ``urls.py``: urlpatterns = [ (...), - url(r'^auth/', include('djoser.urls')), + re_path(r'^auth/', include('djoser.urls')), ] HTTP Basic Auth strategy is assumed by default as Django Rest Framework does it. diff --git a/docs/source/social_endpoints.rst b/docs/source/social_endpoints.rst index 2ee97ba1..b1a4ec44 100644 --- a/docs/source/social_endpoints.rst +++ b/docs/source/social_endpoints.rst @@ -34,7 +34,7 @@ Configure ``urls.py``: urlpatterns = [ (...), - url(r'^auth/', include('djoser.social.urls')), + re_path(r'^auth/', include('djoser.social.urls')), ] **Default URL**: ``/o/{{ provider }}/`` diff --git a/docs/source/webauthn.rst b/docs/source/webauthn.rst index 4795a18c..3ed42f08 100644 --- a/docs/source/webauthn.rst +++ b/docs/source/webauthn.rst @@ -29,7 +29,7 @@ Add ``djoser.webauthn.urls`` url patterns to ``urls.py``: urlpatterns = [ (...), - url(r'^auth/webauthn/', include('djoser.webauthn.urls')), + re_path(r'^auth/webauthn/', include('djoser.webauthn.urls')), ]