django.conf.urls.url() was deprecated in Django 3.0, and was removed in
authorDan Langille <dan@langille.org>
Fri, 9 Aug 2024 01:22:16 +0000 (01:22 +0000)
committerMagnus Hagander <magnus@hagander.net>
Fri, 9 Aug 2024 06:10:34 +0000 (08:10 +0200)
Django 4.0

postgresqleu/oauthlogin/urls.py

index 5478710accab16e373fbf0f728e9805cc9a22c9f..d1e24a2760da37568b5d9aee091bea19e7ddbf56 100644 (file)
@@ -1,4 +1,4 @@
-from django.conf.urls import url
+from django.urls import re_path
 from django.views.generic import RedirectView
 
 from django.conf import settings
@@ -10,12 +10,12 @@ postgresqleu.oauthlogin.oauthclient.configure()
 
 
 oauthurlpatterns = [
-    url(r'^accounts/login/?$', postgresqleu.oauthlogin.views.login),
-    url(r'^accounts/logout/?$', postgresqleu.oauthlogin.views.logout),
-    url(r'^login/$', RedirectView.as_view(url='/accounts/login/')),
-    url(r'^logout/$', RedirectView.as_view(url='/accounts/logout/')),
+    re_path(r'^accounts/login/?$', postgresqleu.oauthlogin.views.login),
+    re_path(r'^accounts/logout/?$', postgresqleu.oauthlogin.views.logout),
+    re_path(r'^login/$', RedirectView.as_view(url='/accounts/login/')),
+    re_path(r'^logout/$', RedirectView.as_view(url='/accounts/logout/')),
 ]
 
 
 for provider in list(settings.OAUTH.keys()):
-    oauthurlpatterns.append(url(r'^accounts/login/({0})/$'.format(provider), postgresqleu.oauthlogin.oauthclient.login_oauth))
+    oauthurlpatterns.append(re_path(r'^accounts/login/({0})/$'.format(provider), postgresqleu.oauthlogin.oauthclient.login_oauth))