From d9266fd82c1f0acc6b7236a6dc9b7e510985eb13 Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Thu, 27 Jan 2022 00:07:02 +0900 Subject: Address RemovedInDjango40Warning (3) In Django 3.1, django.conf.urls.url() is deprecated in favor of django.urls.re_path(). https://docs.djangoproject.com/en/4.0/releases/3.1/#id2 Change-Id: I484694f8718f61c022126a1935cf28fce075894b --- openstack_auth/tests/urls.py | 9 +++++---- openstack_auth/urls.py | 39 ++++++++++++++++++++------------------- 2 files changed, 25 insertions(+), 23 deletions(-) (limited to 'openstack_auth') diff --git a/openstack_auth/tests/urls.py b/openstack_auth/tests/urls.py index 0a32b0841..eaafce525 100644 --- a/openstack_auth/tests/urls.py +++ b/openstack_auth/tests/urls.py @@ -12,14 +12,15 @@ # limitations under the License. from django.conf.urls import include -from django.conf.urls import url +from django.urls import re_path from django.views import generic from openstack_auth import views urlpatterns = [ - url(r"", include('openstack_auth.urls')), - url(r"^websso/$", views.websso, name='websso'), - url(r"^$", generic.TemplateView.as_view(template_name="auth/blank.html")) + re_path(r"", include('openstack_auth.urls')), + re_path(r"^websso/$", views.websso, name='websso'), + re_path(r"^$", + generic.TemplateView.as_view(template_name="auth/blank.html")) ] diff --git a/openstack_auth/urls.py b/openstack_auth/urls.py index 40160e461..027ce803d 100644 --- a/openstack_auth/urls.py +++ b/openstack_auth/urls.py @@ -12,7 +12,7 @@ # limitations under the License. from django.conf import settings -from django.conf.urls import url +from django.urls import re_path from django.views import generic from openstack_auth import utils @@ -20,30 +20,31 @@ from openstack_auth import views urlpatterns = [ - url(r"^login/$", views.login, name='login'), - url(r"^logout/$", views.logout, name='logout'), - url(r'^switch/(?P[^/]+)/$', views.switch, - name='switch_tenants'), - url(r'^switch_services_region/(?P[^/]+)/$', - views.switch_region, - name='switch_services_region'), - url(r'^switch_keystone_provider/(?P[^/]+)/$', - views.switch_keystone_provider, - name='switch_keystone_provider'), - url(r'^switch_system_scope/$', - views.switch_system_scope, - name='switch_system_scope'), + re_path(r"^login/$", views.login, name='login'), + re_path(r"^logout/$", views.logout, name='logout'), + re_path(r'^switch/(?P[^/]+)/$', views.switch, + name='switch_tenants'), + re_path(r'^switch_services_region/(?P[^/]+)/$', + views.switch_region, + name='switch_services_region'), + re_path(r'^switch_keystone_provider/(?P[^/]+)/$', + views.switch_keystone_provider, + name='switch_keystone_provider'), + re_path(r'^switch_system_scope/$', + views.switch_system_scope, + name='switch_system_scope'), ] if utils.allow_expired_passowrd_change(): urlpatterns.append( - url(r'^password/(?P[^/]+)/$', views.PasswordView.as_view(), - name='password') + re_path(r'^password/(?P[^/]+)/$', + views.PasswordView.as_view(), + name='password') ) if settings.WEBSSO_ENABLED: urlpatterns += [ - url(r"^websso/$", views.websso, name='websso'), - url(r"^error/$", - generic.TemplateView.as_view(template_name="403.html")) + re_path(r"^websso/$", views.websso, name='websso'), + re_path(r"^error/$", + generic.TemplateView.as_view(template_name="403.html")) ] -- cgit v1.2.1