From d9266fd82c1f0acc6b7236a6dc9b7e510985eb13 Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Thu, 27 Jan 2022 00:07:02 +0900 Subject: [PATCH] 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 --- .../contributor/tutorials/dashboard.rst | 4 +- doc/source/contributor/tutorials/plugin.rst | 4 +- .../contributor/tutorials/table_actions.rst | 12 +-- horizon/base.py | 14 +-- horizon/conf/panel_template/urls.py.tmpl | 4 +- horizon/site_urls.py | 30 +++--- .../test/test_dashboards/cats/kittens/urls.py | 4 +- .../test/test_dashboards/cats/tigers/urls.py | 4 +- .../test/test_dashboards/dogs/puppies/urls.py | 6 +- horizon/test/urls.py | 22 ++--- openstack_auth/tests/urls.py | 9 +- openstack_auth/urls.py | 39 ++++---- openstack_dashboard/api/rest/urls.py | 5 +- .../contrib/developer/form_builder/urls.py | 4 +- .../contrib/developer/profiler/urls.py | 4 +- .../developer/resource_browser/urls.py | 4 +- .../contrib/developer/theme_preview/urls.py | 4 +- .../dashboards/admin/aggregates/urls.py | 18 ++-- .../dashboards/admin/backups/urls.py | 22 ++--- .../dashboards/admin/defaults/urls.py | 8 +- .../dashboards/admin/flavors/urls.py | 21 ++-- .../dashboards/admin/floating_ips/urls.py | 10 +- .../admin/group_types/specs/urls.py | 10 +- .../dashboards/admin/group_types/urls.py | 18 ++-- .../admin/hypervisors/compute/urls.py | 20 ++-- .../dashboards/admin/hypervisors/urls.py | 12 +-- .../dashboards/admin/images/urls.py | 20 ++-- .../dashboards/admin/info/urls.py | 4 +- .../dashboards/admin/instances/urls.py | 25 ++--- .../dashboards/admin/metadata_defs/urls.py | 14 +-- .../dashboards/admin/networks/ports/urls.py | 10 +- .../dashboards/admin/networks/subnets/urls.py | 4 +- .../dashboards/admin/networks/urls.py | 46 ++++----- .../dashboards/admin/ngflavors/urls.py | 4 +- .../dashboards/admin/overview/urls.py | 4 +- .../dashboards/admin/rbac_policies/urls.py | 18 ++-- .../dashboards/admin/routers/ports/urls.py | 4 +- .../dashboards/admin/routers/urls.py | 24 ++--- .../dashboards/admin/snapshots/urls.py | 16 ++-- .../dashboards/admin/trunks/urls.py | 8 +- .../dashboards/admin/vg_snapshots/urls.py | 10 +- .../dashboards/admin/volume_groups/urls.py | 28 +++--- .../admin/volume_types/extras/urls.py | 8 +- .../admin/volume_types/qos_specs/urls.py | 13 +-- .../dashboards/admin/volume_types/urls.py | 60 ++++++------ .../dashboards/admin/volumes/urls.py | 38 ++++---- .../identity/application_credentials/urls.py | 26 ++--- .../dashboards/identity/domains/urls.py | 13 +-- .../dashboards/identity/groups/urls.py | 20 ++-- .../identity_providers/protocols/urls.py | 4 +- .../identity/identity_providers/urls.py | 26 ++--- .../dashboards/identity/mappings/urls.py | 10 +- .../dashboards/identity/projects/urls.py | 22 ++--- .../dashboards/identity/roles/urls.py | 12 +-- .../dashboards/identity/users/urls.py | 20 ++-- .../dashboards/project/api_access/urls.py | 21 ++-- .../dashboards/project/backups/urls.py | 16 ++-- .../dashboards/project/containers/urls.py | 12 +-- .../dashboards/project/floating_ips/urls.py | 8 +- .../dashboards/project/images/images/urls.py | 17 ++-- .../project/images/snapshots/urls.py | 8 +- .../dashboards/project/images/urls.py | 14 +-- .../dashboards/project/instances/urls.py | 65 +++++++------ .../dashboards/project/key_pairs/urls.py | 19 ++-- .../dashboards/project/network_qos/urls.py | 4 +- .../project/network_topology/urls.py | 38 ++++---- .../dashboards/project/networks/ports/urls.py | 10 +- .../project/networks/subnets/urls.py | 4 +- .../dashboards/project/networks/urls.py | 42 ++++---- .../dashboards/project/overview/urls.py | 6 +- .../dashboards/project/routers/ports/urls.py | 4 +- .../dashboards/project/routers/urls.py | 36 +++---- .../project/security_groups/urls.py | 24 ++--- .../dashboards/project/server_groups/urls.py | 4 +- .../dashboards/project/snapshots/urls.py | 16 ++-- .../dashboards/project/trunks/urls.py | 8 +- .../dashboards/project/vg_snapshots/urls.py | 16 ++-- .../dashboards/project/volume_groups/urls.py | 52 +++++----- .../dashboards/project/volumes/urls.py | 96 +++++++++---------- .../dashboards/settings/password/urls.py | 4 +- .../dashboards/settings/user/urls.py | 4 +- openstack_dashboard/test/error_pages_urls.py | 4 +- .../test/extensible_header_urls.py | 4 +- .../test/test_panels/another_panel/urls.py | 4 +- .../test/test_panels/nonloading_panel/urls.py | 4 +- .../test/test_panels/plugin_panel/urls.py | 4 +- .../test/test_panels/second_panel/urls.py | 4 +- openstack_dashboard/test/urls.py | 20 ++-- openstack_dashboard/urls.py | 20 ++-- 89 files changed, 725 insertions(+), 710 deletions(-) diff --git a/doc/source/contributor/tutorials/dashboard.rst b/doc/source/contributor/tutorials/dashboard.rst index 8231add4ca..f7a6692a23 100644 --- a/doc/source/contributor/tutorials/dashboard.rst +++ b/doc/source/contributor/tutorials/dashboard.rst @@ -458,13 +458,13 @@ URLs ---- The auto-generated ``urls.py`` file is like:: - from django.conf.urls import url + from django.urls import re_path from openstack_dashboard.dashboards.mydashboard.mypanel import views urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), + re_path(r'^$', views.IndexView.as_view(), name='index'), ] diff --git a/doc/source/contributor/tutorials/plugin.rst b/doc/source/contributor/tutorials/plugin.rst index 9fcd62822e..13b80c1f6a 100644 --- a/doc/source/contributor/tutorials/plugin.rst +++ b/doc/source/contributor/tutorials/plugin.rst @@ -209,12 +209,12 @@ urls.py Now that we have a panel, we need to provide a URL so that users can visit our new panel! This URL generally will point to a view.:: - from django.conf.urls import url + from django.urls import re_path from myplugin.content.mypanel import views urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), + re_path(r'^$', views.IndexView.as_view(), name='index'), ] views.py diff --git a/doc/source/contributor/tutorials/table_actions.rst b/doc/source/contributor/tutorials/table_actions.rst index 721bdb3495..ebde02c8d0 100644 --- a/doc/source/contributor/tutorials/table_actions.rst +++ b/doc/source/contributor/tutorials/table_actions.rst @@ -176,17 +176,17 @@ the ``mypanel`` directory and add the following as a new url pattern:: The complete ``urls.py`` file should look like this:: - from django.conf.urls import url + from django.urls import re_path from openstack_dashboard.dashboards.mydashboard.mypanel import views urlpatterns = [ - url(r'^$', - views.IndexView.as_view(), name='index'), - url(r'^(?P[^/]+)/create_snapshot/$', - views.CreateSnapshotView.as_view(), - name='create_snapshot'), + re_path(r'^$', + views.IndexView.as_view(), name='index'), + re_path(r'^(?P[^/]+)/create_snapshot/$', + views.CreateSnapshotView.as_view(), + name='create_snapshot'), ] diff --git a/horizon/base.py b/horizon/base.py index 8f574834b3..463a773005 100644 --- a/horizon/base.py +++ b/horizon/base.py @@ -31,8 +31,8 @@ import os from django.conf import settings from django.conf.urls import include -from django.conf.urls import url from django.core.exceptions import ImproperlyConfigured +from django.urls import re_path from django.urls import reverse from django.utils.functional import empty from django.utils.functional import SimpleLazyObject @@ -550,14 +550,15 @@ class Dashboard(Registry, HorizonComponent): default_panel = panel continue url_slug = panel.slug.replace('.', '/') - urlpatterns.append(url(r'^%s/' % url_slug, - _wrapped_include(panel._decorated_urls))) + urlpatterns.append( + re_path(r'^%s/' % url_slug, + _wrapped_include(panel._decorated_urls))) # Now the default view, which should come last if not default_panel: raise NotRegistered('The default panel "%s" is not registered.' % self.default_panel) urlpatterns.append( - url(r'', _wrapped_include(default_panel._decorated_urls))) + re_path(r'', _wrapped_include(default_panel._decorated_urls))) # Apply access controls to all views in the patterns permissions = getattr(self, 'permissions', []) @@ -871,8 +872,9 @@ class Site(Registry, HorizonComponent): # Compile the dynamic urlconf. for dash in self._registry.values(): - urlpatterns.append(url(r'^%s/' % dash.slug, - _wrapped_include(dash._decorated_urls))) + urlpatterns.append( + re_path(r'^%s/' % dash.slug, + _wrapped_include(dash._decorated_urls))) # Return the three arguments to django.conf.urls.include return urlpatterns, self.namespace, self.slug diff --git a/horizon/conf/panel_template/urls.py.tmpl b/horizon/conf/panel_template/urls.py.tmpl index 6b04c3476c..817385bcb2 100644 --- a/horizon/conf/panel_template/urls.py.tmpl +++ b/horizon/conf/panel_template/urls.py.tmpl @@ -10,11 +10,11 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from {{ dash_path }}.{{ panel_name }} import views urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), + re_path(r'^$', views.IndexView.as_view(), name='index'), ] diff --git a/horizon/site_urls.py b/horizon/site_urls.py index 5028814d17..890d5d6a63 100644 --- a/horizon/site_urls.py +++ b/horizon/site_urls.py @@ -18,7 +18,7 @@ from django.conf import settings from django.conf.urls import include -from django.conf.urls import url +from django.urls import re_path from django.utils import timezone from django.views.decorators.http import last_modified from django.views.generic import TemplateView @@ -28,28 +28,28 @@ from horizon.test.jasmine import jasmine from horizon import views urlpatterns = [ - url(r'^home/$', views.user_home, name='user_home') + re_path(r'^home/$', views.user_home, name='user_home') ] last_modified_date = timezone.now() # Client-side i18n URLconf. urlpatterns.extend([ - url(r'^i18n/js/(?P\S+?)/$', - last_modified(lambda req, **kw: last_modified_date)( - i18n.JavaScriptCatalog.as_view()), - name='jsi18n'), - url(r'^i18n/setlang/$', - i18n.set_language, - name="set_language"), - url(r'^i18n/', include('django.conf.urls.i18n')) + re_path(r'^i18n/js/(?P\S+?)/$', + last_modified(lambda req, **kw: last_modified_date)( + i18n.JavaScriptCatalog.as_view()), + name='jsi18n'), + re_path(r'^i18n/setlang/$', + i18n.set_language, + name="set_language"), + re_path(r'^i18n/', include('django.conf.urls.i18n')) ]) if settings.DEBUG: urlpatterns.extend([ - url(r'^jasmine-legacy/$', - TemplateView.as_view( - template_name="horizon/jasmine/jasmine_legacy.html"), - name='jasmine_tests'), - url(r'^jasmine/.*?$', jasmine.dispatcher), + re_path(r'^jasmine-legacy/$', + TemplateView.as_view( + template_name="horizon/jasmine/jasmine_legacy.html"), + name='jasmine_tests'), + re_path(r'^jasmine/.*?$', jasmine.dispatcher), ]) diff --git a/horizon/test/test_dashboards/cats/kittens/urls.py b/horizon/test/test_dashboards/cats/kittens/urls.py index 1a8944c4c0..1c8808b80d 100644 --- a/horizon/test/test_dashboards/cats/kittens/urls.py +++ b/horizon/test/test_dashboards/cats/kittens/urls.py @@ -10,10 +10,10 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from horizon.test.test_dashboards.cats.kittens.views import IndexView urlpatterns = [ - url(r'^$', IndexView.as_view(), name='index'), + re_path(r'^$', IndexView.as_view(), name='index'), ] diff --git a/horizon/test/test_dashboards/cats/tigers/urls.py b/horizon/test/test_dashboards/cats/tigers/urls.py index 3bf05a75d0..c85e46b1f3 100644 --- a/horizon/test/test_dashboards/cats/tigers/urls.py +++ b/horizon/test/test_dashboards/cats/tigers/urls.py @@ -10,10 +10,10 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from horizon.test.test_dashboards.cats.tigers.views import IndexView urlpatterns = [ - url(r'^$', IndexView.as_view(), name='index'), + re_path(r'^$', IndexView.as_view(), name='index'), ] diff --git a/horizon/test/test_dashboards/dogs/puppies/urls.py b/horizon/test/test_dashboards/dogs/puppies/urls.py index 5a4853092d..0a74cd6e8f 100644 --- a/horizon/test/test_dashboards/dogs/puppies/urls.py +++ b/horizon/test/test_dashboards/dogs/puppies/urls.py @@ -10,12 +10,12 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from horizon.test.test_dashboards.dogs.puppies.views import IndexView from horizon.test.test_dashboards.dogs.puppies.views import TwoTabsView urlpatterns = [ - url(r'^$', IndexView.as_view(), name='index'), - url(r'^tabs/$', TwoTabsView.as_view(), name='tabs'), + re_path(r'^$', IndexView.as_view(), name='index'), + re_path(r'^tabs/$', TwoTabsView.as_view(), name='tabs'), ] diff --git a/horizon/test/urls.py b/horizon/test/urls.py index 359a782f37..22e710929d 100644 --- a/horizon/test/urls.py +++ b/horizon/test/urls.py @@ -21,9 +21,9 @@ URL patterns for testing Horizon views. """ from django.conf.urls import include -from django.conf.urls import url from django.contrib.auth import views from django.contrib.staticfiles.urls import staticfiles_urlpatterns +from django.urls import re_path from django.views.generic import TemplateView import horizon @@ -32,16 +32,16 @@ from horizon.test.jasmine import jasmine urlpatterns = [ - url(r'', horizon.base._wrapped_include(horizon.urls)), - url(r"auth/login/", - views.LoginView.as_view(template_name="auth/login.html"), - name='login'), - url(r'auth/', include('django.contrib.auth.urls')), - url(r'^jasmine/.*?$', jasmine.dispatcher), - url(r'^jasmine-legacy/$', - TemplateView.as_view( - template_name="horizon/jasmine/jasmine_legacy.html"), - name='jasmine_tests'), + re_path(r'', horizon.base._wrapped_include(horizon.urls)), + re_path(r"auth/login/", + views.LoginView.as_view(template_name="auth/login.html"), + name='login'), + re_path(r'auth/', include('django.contrib.auth.urls')), + re_path(r'^jasmine/.*?$', jasmine.dispatcher), + re_path(r'^jasmine-legacy/$', + TemplateView.as_view( + template_name="horizon/jasmine/jasmine_legacy.html"), + name='jasmine_tests'), ] urlpatterns += staticfiles_urlpatterns() diff --git a/openstack_auth/tests/urls.py b/openstack_auth/tests/urls.py index 0a32b08418..eaafce5258 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 40160e461f..027ce803d7 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")) ] diff --git a/openstack_dashboard/api/rest/urls.py b/openstack_dashboard/api/rest/urls.py index 8ba2465868..ed07451587 100644 --- a/openstack_dashboard/api/rest/urls.py +++ b/openstack_dashboard/api/rest/urls.py @@ -11,7 +11,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -from django.conf import urls + +from django.urls import re_path urlpatterns = [] @@ -27,6 +28,6 @@ def register(view): as_view() method. The url_regex attribute of the view should be a standard Django URL regex pattern. """ - p = urls.url(view.url_regex, view.as_view()) + p = re_path(view.url_regex, view.as_view()) urlpatterns.append(p) return view diff --git a/openstack_dashboard/contrib/developer/form_builder/urls.py b/openstack_dashboard/contrib/developer/form_builder/urls.py index d74763b1b7..10ff9fcf10 100644 --- a/openstack_dashboard/contrib/developer/form_builder/urls.py +++ b/openstack_dashboard/contrib/developer/form_builder/urls.py @@ -12,10 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.contrib.developer.form_builder import views urlpatterns = [ - url('', views.IndexView.as_view(), name='index'), + re_path('', views.IndexView.as_view(), name='index'), ] diff --git a/openstack_dashboard/contrib/developer/profiler/urls.py b/openstack_dashboard/contrib/developer/profiler/urls.py index 78549a3554..2b2f2493e5 100644 --- a/openstack_dashboard/contrib/developer/profiler/urls.py +++ b/openstack_dashboard/contrib/developer/profiler/urls.py @@ -14,11 +14,11 @@ # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.contrib.developer.profiler import views urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), + re_path(r'^$', views.IndexView.as_view(), name='index'), ] diff --git a/openstack_dashboard/contrib/developer/resource_browser/urls.py b/openstack_dashboard/contrib/developer/resource_browser/urls.py index 05137b9800..4c40165fa2 100644 --- a/openstack_dashboard/contrib/developer/resource_browser/urls.py +++ b/openstack_dashboard/contrib/developer/resource_browser/urls.py @@ -12,10 +12,10 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from horizon.browsers.views import AngularIndexView urlpatterns = [ - url('', AngularIndexView.as_view(), name='index'), + re_path('', AngularIndexView.as_view(), name='index'), ] diff --git a/openstack_dashboard/contrib/developer/theme_preview/urls.py b/openstack_dashboard/contrib/developer/theme_preview/urls.py index 9fea8f73d5..c6db37d0b4 100644 --- a/openstack_dashboard/contrib/developer/theme_preview/urls.py +++ b/openstack_dashboard/contrib/developer/theme_preview/urls.py @@ -12,11 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.contrib.developer.theme_preview import views urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), + re_path(r'^$', views.IndexView.as_view(), name='index'), ] diff --git a/openstack_dashboard/dashboards/admin/aggregates/urls.py b/openstack_dashboard/dashboards/admin/aggregates/urls.py index fc15d0bf61..5b143d61f1 100644 --- a/openstack_dashboard/dashboards/admin/aggregates/urls.py +++ b/openstack_dashboard/dashboards/admin/aggregates/urls.py @@ -10,19 +10,19 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.admin.aggregates \ import views urlpatterns = [ - url(r'^$', - views.IndexView.as_view(), name='index'), - url(r'^create/$', - views.CreateView.as_view(), name='create'), - url(r'^(?P[^/]+)/update/$', - views.UpdateView.as_view(), name='update'), - url(r'^(?P[^/]+)/manage_hosts/$', - views.ManageHostsView.as_view(), name='manage_hosts'), + re_path(r'^$', + views.IndexView.as_view(), name='index'), + re_path(r'^create/$', + views.CreateView.as_view(), name='create'), + re_path(r'^(?P[^/]+)/update/$', + views.UpdateView.as_view(), name='update'), + re_path(r'^(?P[^/]+)/manage_hosts/$', + views.ManageHostsView.as_view(), name='manage_hosts'), ] diff --git a/openstack_dashboard/dashboards/admin/backups/urls.py b/openstack_dashboard/dashboards/admin/backups/urls.py index a90b68aaa6..95cfb56fa3 100644 --- a/openstack_dashboard/dashboards/admin/backups/urls.py +++ b/openstack_dashboard/dashboards/admin/backups/urls.py @@ -10,20 +10,20 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.admin.backups import views urlpatterns = [ - url(r'^$', views.AdminBackupsView.as_view(), name='index'), - url(r'^(?P[^/]+)/$', - views.AdminBackupDetailView.as_view(), - name='detail'), - url(r'^(?P[^/]+)/restore/$', - views.AdminRestoreBackupView.as_view(), - name='restore'), - url(r'^(?P[^/]+)/update_status$', - views.UpdateStatusView.as_view(), - name='update_status'), + re_path(r'^$', views.AdminBackupsView.as_view(), name='index'), + re_path(r'^(?P[^/]+)/$', + views.AdminBackupDetailView.as_view(), + name='detail'), + re_path(r'^(?P[^/]+)/restore/$', + views.AdminRestoreBackupView.as_view(), + name='restore'), + re_path(r'^(?P[^/]+)/update_status$', + views.UpdateStatusView.as_view(), + name='update_status'), ] diff --git a/openstack_dashboard/dashboards/admin/defaults/urls.py b/openstack_dashboard/dashboards/admin/defaults/urls.py index 89a4b834f0..f41fb7762c 100644 --- a/openstack_dashboard/dashboards/admin/defaults/urls.py +++ b/openstack_dashboard/dashboards/admin/defaults/urls.py @@ -12,13 +12,13 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.admin.defaults import views urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), - url(r'^update_defaults$', - views.UpdateDefaultQuotasView.as_view(), name='update_defaults'), + re_path(r'^$', views.IndexView.as_view(), name='index'), + re_path(r'^update_defaults$', + views.UpdateDefaultQuotasView.as_view(), name='update_defaults'), ] diff --git a/openstack_dashboard/dashboards/admin/flavors/urls.py b/openstack_dashboard/dashboards/admin/flavors/urls.py index d9f2625a82..3050abcaaf 100644 --- a/openstack_dashboard/dashboards/admin/flavors/urls.py +++ b/openstack_dashboard/dashboards/admin/flavors/urls.py @@ -16,7 +16,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from django.utils.translation import gettext_lazy as _ from horizon.browsers.views import AngularIndexView @@ -28,16 +28,17 @@ if setting_utils.get_dict_config('ANGULAR_FEATURES', 'flavors_panel'): title = _("Flavors") # New angular panel urlpatterns = [ - url(r'^$', AngularIndexView.as_view(title=title), name='index'), - url(r'^create/$', AngularIndexView.as_view(title=title), - name='create'), - url(r'^(?P[^/]+)/update/$', AngularIndexView.as_view(title=title), - name='index'), + re_path(r'^$', AngularIndexView.as_view(title=title), name='index'), + re_path(r'^create/$', AngularIndexView.as_view(title=title), + name='create'), + re_path(r'^(?P[^/]+)/update/$', + AngularIndexView.as_view(title=title), + name='index'), ] else: urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), - url(r'^create/$', views.CreateView.as_view(), name='create'), - url(r'^(?P[^/]+)/update/$', - views.UpdateView.as_view(), name='update'), + re_path(r'^$', views.IndexView.as_view(), name='index'), + re_path(r'^create/$', views.CreateView.as_view(), name='create'), + re_path(r'^(?P[^/]+)/update/$', + views.UpdateView.as_view(), name='update'), ] diff --git a/openstack_dashboard/dashboards/admin/floating_ips/urls.py b/openstack_dashboard/dashboards/admin/floating_ips/urls.py index 8c19a5274d..428d943f89 100644 --- a/openstack_dashboard/dashboards/admin/floating_ips/urls.py +++ b/openstack_dashboard/dashboards/admin/floating_ips/urls.py @@ -13,14 +13,14 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.admin.floating_ips import views urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), - url(r'^allocate/$', views.AllocateView.as_view(), name='allocate'), - url(r'^(?P[^/]+)/detail/$', - views.DetailView.as_view(), name='detail') + re_path(r'^$', views.IndexView.as_view(), name='index'), + re_path(r'^allocate/$', views.AllocateView.as_view(), name='allocate'), + re_path(r'^(?P[^/]+)/detail/$', + views.DetailView.as_view(), name='detail') ] diff --git a/openstack_dashboard/dashboards/admin/group_types/specs/urls.py b/openstack_dashboard/dashboards/admin/group_types/specs/urls.py index 1b26608dcb..231d45835a 100644 --- a/openstack_dashboard/dashboards/admin/group_types/specs/urls.py +++ b/openstack_dashboard/dashboards/admin/group_types/specs/urls.py @@ -10,13 +10,15 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.admin.group_types.specs \ import views urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), - url(r'^create/$', views.CreateView.as_view(), name='create'), - url(r'^(?P[^/]+)/edit/$', views.EditView.as_view(), name='edit'), + re_path(r'^$', views.IndexView.as_view(), name='index'), + re_path(r'^create/$', views.CreateView.as_view(), name='create'), + re_path(r'^(?P[^/]+)/edit/$', + views.EditView.as_view(), + name='edit'), ] diff --git a/openstack_dashboard/dashboards/admin/group_types/urls.py b/openstack_dashboard/dashboards/admin/group_types/urls.py index 543b86e45a..09bc9fa6c6 100644 --- a/openstack_dashboard/dashboards/admin/group_types/urls.py +++ b/openstack_dashboard/dashboards/admin/group_types/urls.py @@ -11,7 +11,7 @@ # under the License. from django.conf.urls import include -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.admin.group_types.specs \ import urls as specs_urls @@ -20,12 +20,12 @@ from openstack_dashboard.dashboards.admin.group_types \ urlpatterns = [ - url(r'^$', views.GroupTypesView.as_view(), name='index'), - url(r'^create_type$', views.CreateGroupTypeView.as_view(), - name='create_type'), - url(r'^(?P[^/]+)/update_type/$', - views.EditGroupTypeView.as_view(), - name='update_type'), - url(r'^(?P[^/]+)/specs/', - include((specs_urls, 'specs'))), + re_path(r'^$', views.GroupTypesView.as_view(), name='index'), + re_path(r'^create_type$', views.CreateGroupTypeView.as_view(), + name='create_type'), + re_path(r'^(?P[^/]+)/update_type/$', + views.EditGroupTypeView.as_view(), + name='update_type'), + re_path(r'^(?P[^/]+)/specs/', + include((specs_urls, 'specs'))), ] diff --git a/openstack_dashboard/dashboards/admin/hypervisors/compute/urls.py b/openstack_dashboard/dashboards/admin/hypervisors/compute/urls.py index 624e49f6a7..f462d69f06 100644 --- a/openstack_dashboard/dashboards/admin/hypervisors/compute/urls.py +++ b/openstack_dashboard/dashboards/admin/hypervisors/compute/urls.py @@ -10,19 +10,19 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.admin.hypervisors.compute import views urlpatterns = [ - url(r'^(?P[^/]+)/evacuate_host$', - views.EvacuateHostView.as_view(), - name='evacuate_host'), - url(r'^(?P[^/]+)/disable_service$', - views.DisableServiceView.as_view(), - name='disable_service'), - url(r'^(?P[^/]+)/migrate_host$', - views.MigrateHostView.as_view(), - name='migrate_host'), + re_path(r'^(?P[^/]+)/evacuate_host$', + views.EvacuateHostView.as_view(), + name='evacuate_host'), + re_path(r'^(?P[^/]+)/disable_service$', + views.DisableServiceView.as_view(), + name='disable_service'), + re_path(r'^(?P[^/]+)/migrate_host$', + views.MigrateHostView.as_view(), + name='migrate_host'), ] diff --git a/openstack_dashboard/dashboards/admin/hypervisors/urls.py b/openstack_dashboard/dashboards/admin/hypervisors/urls.py index f487fb6da5..f80e0d9509 100644 --- a/openstack_dashboard/dashboards/admin/hypervisors/urls.py +++ b/openstack_dashboard/dashboards/admin/hypervisors/urls.py @@ -13,7 +13,7 @@ # under the License. from django.conf.urls import include -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.admin.hypervisors.compute \ import urls as compute_urls @@ -21,9 +21,9 @@ from openstack_dashboard.dashboards.admin.hypervisors import views urlpatterns = [ - url(r'^(?P[^/]+)/$', - views.AdminDetailView.as_view(), - name='detail'), - url(r'^$', views.AdminIndexView.as_view(), name='index'), - url(r'', include((compute_urls, 'compute'))), + re_path(r'^(?P[^/]+)/$', + views.AdminDetailView.as_view(), + name='detail'), + re_path(r'^$', views.AdminIndexView.as_view(), name='index'), + re_path(r'', include((compute_urls, 'compute'))), ] diff --git a/openstack_dashboard/dashboards/admin/images/urls.py b/openstack_dashboard/dashboards/admin/images/urls.py index cc50286189..3bb9c96b90 100644 --- a/openstack_dashboard/dashboards/admin/images/urls.py +++ b/openstack_dashboard/dashboards/admin/images/urls.py @@ -16,7 +16,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from django.utils.translation import gettext_lazy as _ from horizon.browsers.views import AngularIndexView @@ -27,16 +27,16 @@ if setting_utils.get_dict_config('ANGULAR_FEATURES', 'images_panel'): title = _("Images") # New angular images urlpatterns = [ - url(r'^$', AngularIndexView.as_view(title=title), name='index'), - url(r'^(?P[^/]+)/detail/$', - AngularIndexView.as_view(title=title), name='detail'), + re_path(r'^$', AngularIndexView.as_view(title=title), name='index'), + re_path(r'^(?P[^/]+)/detail/$', + AngularIndexView.as_view(title=title), name='detail'), ] else: urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), - url(r'^create/$', views.CreateView.as_view(), name='create'), - url(r'^(?P[^/]+)/update/$', - views.UpdateView.as_view(), name='update'), - url(r'^(?P[^/]+)/detail/$', - views.DetailView.as_view(), name='detail') + re_path(r'^$', views.IndexView.as_view(), name='index'), + re_path(r'^create/$', views.CreateView.as_view(), name='create'), + re_path(r'^(?P[^/]+)/update/$', + views.UpdateView.as_view(), name='update'), + re_path(r'^(?P[^/]+)/detail/$', + views.DetailView.as_view(), name='detail') ] diff --git a/openstack_dashboard/dashboards/admin/info/urls.py b/openstack_dashboard/dashboards/admin/info/urls.py index 2a9c096cec..f51431c479 100644 --- a/openstack_dashboard/dashboards/admin/info/urls.py +++ b/openstack_dashboard/dashboards/admin/info/urls.py @@ -16,11 +16,11 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.admin.info import views urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), + re_path(r'^$', views.IndexView.as_view(), name='index'), ] diff --git a/openstack_dashboard/dashboards/admin/instances/urls.py b/openstack_dashboard/dashboards/admin/instances/urls.py index 7029d46fc0..2798e0cebc 100644 --- a/openstack_dashboard/dashboards/admin/instances/urls.py +++ b/openstack_dashboard/dashboards/admin/instances/urls.py @@ -16,7 +16,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.admin.instances import views @@ -25,15 +25,16 @@ INSTANCES = r'^(?P[^/]+)/%s$' urlpatterns = [ - url(r'^$', views.AdminIndexView.as_view(), name='index'), - url(INSTANCES % 'update', views.AdminUpdateView.as_view(), name='update'), - url(INSTANCES % 'detail', views.DetailView.as_view(), name='detail'), - url(INSTANCES % 'console', views.console, name='console'), - url(INSTANCES % 'vnc', views.vnc, name='vnc'), - url(INSTANCES % 'mks', views.mks, name='mks'), - url(INSTANCES % 'spice', views.spice, name='spice'), - url(INSTANCES % 'rdp', views.rdp, name='rdp'), - url(INSTANCES % 'live_migrate', views.LiveMigrateView.as_view(), - name='live_migrate'), - url(INSTANCES % 'rescue', views.RescueView.as_view(), name='rescue'), + re_path(r'^$', views.AdminIndexView.as_view(), name='index'), + re_path(INSTANCES % 'update', views.AdminUpdateView.as_view(), + name='update'), + re_path(INSTANCES % 'detail', views.DetailView.as_view(), name='detail'), + re_path(INSTANCES % 'console', views.console, name='console'), + re_path(INSTANCES % 'vnc', views.vnc, name='vnc'), + re_path(INSTANCES % 'mks', views.mks, name='mks'), + re_path(INSTANCES % 'spice', views.spice, name='spice'), + re_path(INSTANCES % 'rdp', views.rdp, name='rdp'), + re_path(INSTANCES % 'live_migrate', views.LiveMigrateView.as_view(), + name='live_migrate'), + re_path(INSTANCES % 'rescue', views.RescueView.as_view(), name='rescue'), ] diff --git a/openstack_dashboard/dashboards/admin/metadata_defs/urls.py b/openstack_dashboard/dashboards/admin/metadata_defs/urls.py index 2721ff5b3f..b825003a7a 100644 --- a/openstack_dashboard/dashboards/admin/metadata_defs/urls.py +++ b/openstack_dashboard/dashboards/admin/metadata_defs/urls.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.admin.metadata_defs import views @@ -21,10 +21,10 @@ NAMESPACES = r'^(?P[^/]+)/%s$' urlpatterns = [ - url(r'^$', views.AdminIndexView.as_view(), name='index'), - url(r'^create/$', views.CreateView.as_view(), name='create'), - url(NAMESPACES % 'update', views.UpdateView.as_view(), name='update'), - url(NAMESPACES % 'detail', views.DetailView.as_view(), name='detail'), - url(r'^(?P[^/]+)/resource_types/$', - views.ManageResourceTypes.as_view(), name='resource_types'), + re_path(r'^$', views.AdminIndexView.as_view(), name='index'), + re_path(r'^create/$', views.CreateView.as_view(), name='create'), + re_path(NAMESPACES % 'update', views.UpdateView.as_view(), name='update'), + re_path(NAMESPACES % 'detail', views.DetailView.as_view(), name='detail'), + re_path(r'^(?P[^/]+)/resource_types/$', + views.ManageResourceTypes.as_view(), name='resource_types'), ] diff --git a/openstack_dashboard/dashboards/admin/networks/ports/urls.py b/openstack_dashboard/dashboards/admin/networks/ports/urls.py index 9ca9056009..3fbc809140 100644 --- a/openstack_dashboard/dashboards/admin/networks/ports/urls.py +++ b/openstack_dashboard/dashboards/admin/networks/ports/urls.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.admin.networks.ports import views from openstack_dashboard.dashboards.admin.networks.ports.extensions. \ @@ -22,8 +22,8 @@ PORTS = r'^(?P[^/]+)/%s$' urlpatterns = [ - url(PORTS % 'detail', views.DetailView.as_view(), name='detail'), - url(PORTS % 'addallowedaddresspairs', - addr_pairs_views.AddAllowedAddressPair.as_view(), - name='addallowedaddresspairs'), + re_path(PORTS % 'detail', views.DetailView.as_view(), name='detail'), + re_path(PORTS % 'addallowedaddresspairs', + addr_pairs_views.AddAllowedAddressPair.as_view(), + name='addallowedaddresspairs'), ] diff --git a/openstack_dashboard/dashboards/admin/networks/subnets/urls.py b/openstack_dashboard/dashboards/admin/networks/subnets/urls.py index 8b4a507f36..841584a0c4 100644 --- a/openstack_dashboard/dashboards/admin/networks/subnets/urls.py +++ b/openstack_dashboard/dashboards/admin/networks/subnets/urls.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.admin.networks.subnets import views @@ -21,5 +21,5 @@ SUBNETS = r'^(?P[^/]+)/%s$' urlpatterns = [ - url(SUBNETS % 'detail', views.DetailView.as_view(), name='detail'), + re_path(SUBNETS % 'detail', views.DetailView.as_view(), name='detail'), ] diff --git a/openstack_dashboard/dashboards/admin/networks/urls.py b/openstack_dashboard/dashboards/admin/networks/urls.py index 6332201ecf..50fd4fcc61 100644 --- a/openstack_dashboard/dashboards/admin/networks/urls.py +++ b/openstack_dashboard/dashboards/admin/networks/urls.py @@ -13,7 +13,7 @@ # under the License. from django.conf.urls import include -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.admin.networks.agents \ import views as agent_views @@ -32,27 +32,27 @@ NETWORKS = r'^(?P[^/]+)/%s$' urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), - url(r'^create/$', views.CreateView.as_view(), name='create'), - url(NETWORKS % 'update', views.UpdateView.as_view(), name='update'), - url(NETWORKS % 'detail', views.DetailView.as_view(), name='detail'), - url(NETWORKS % r'detail\?tab=network_tabs__ports_tab$', - views.DetailView.as_view(), name='ports_tab'), - url(NETWORKS % r'detail\?tab=network_tabs__agents_tab$', - views.DetailView.as_view(), name='agents_tab'), - url(NETWORKS % r'detail\?tab=network_tabs__subnets_tab$', - views.DetailView.as_view(), name='subnets_tab'), - url(NETWORKS % 'agents/add', - agent_views.AddView.as_view(), name='adddhcpagent'), - url(NETWORKS % 'subnets/create', - subnet_views.CreateView.as_view(), name='createsubnet'), - url(NETWORKS % 'ports/create', - port_views.CreateView.as_view(), name='addport'), - url(r'^(?P[^/]+)/subnets/(?P[^/]+)/update$', - subnet_views.UpdateView.as_view(), name='editsubnet'), - url(r'^(?P[^/]+)/ports/(?P[^/]+)/update$', - port_views.UpdateView.as_view(), name='editport'), + re_path(r'^$', views.IndexView.as_view(), name='index'), + re_path(r'^create/$', views.CreateView.as_view(), name='create'), + re_path(NETWORKS % 'update', views.UpdateView.as_view(), name='update'), + re_path(NETWORKS % 'detail', views.DetailView.as_view(), name='detail'), + re_path(NETWORKS % r'detail\?tab=network_tabs__ports_tab$', + views.DetailView.as_view(), name='ports_tab'), + re_path(NETWORKS % r'detail\?tab=network_tabs__agents_tab$', + views.DetailView.as_view(), name='agents_tab'), + re_path(NETWORKS % r'detail\?tab=network_tabs__subnets_tab$', + views.DetailView.as_view(), name='subnets_tab'), + re_path(NETWORKS % 'agents/add', + agent_views.AddView.as_view(), name='adddhcpagent'), + re_path(NETWORKS % 'subnets/create', + subnet_views.CreateView.as_view(), name='createsubnet'), + re_path(NETWORKS % 'ports/create', + port_views.CreateView.as_view(), name='addport'), + re_path(r'^(?P[^/]+)/subnets/(?P[^/]+)/update$', + subnet_views.UpdateView.as_view(), name='editsubnet'), + re_path(r'^(?P[^/]+)/ports/(?P[^/]+)/update$', + port_views.UpdateView.as_view(), name='editport'), - url(r'^subnets/', include((subnet_urls, 'subnets'))), - url(r'^ports/', include((port_urls, 'ports'))), + re_path(r'^subnets/', include((subnet_urls, 'subnets'))), + re_path(r'^ports/', include((port_urls, 'ports'))), ] diff --git a/openstack_dashboard/dashboards/admin/ngflavors/urls.py b/openstack_dashboard/dashboards/admin/ngflavors/urls.py index 79bcb97a59..883e59496a 100644 --- a/openstack_dashboard/dashboards/admin/ngflavors/urls.py +++ b/openstack_dashboard/dashboards/admin/ngflavors/urls.py @@ -13,11 +13,11 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.admin.ngflavors import views urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), + re_path(r'^$', views.IndexView.as_view(), name='index'), ] diff --git a/openstack_dashboard/dashboards/admin/overview/urls.py b/openstack_dashboard/dashboards/admin/overview/urls.py index 652ec643ff..567ab4c7fe 100644 --- a/openstack_dashboard/dashboards/admin/overview/urls.py +++ b/openstack_dashboard/dashboards/admin/overview/urls.py @@ -17,11 +17,11 @@ # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.admin.overview import views urlpatterns = [ - url(r'^$', views.GlobalOverview.as_view(), name='index'), + re_path(r'^$', views.GlobalOverview.as_view(), name='index'), ] diff --git a/openstack_dashboard/dashboards/admin/rbac_policies/urls.py b/openstack_dashboard/dashboards/admin/rbac_policies/urls.py index b7a1ab8588..7a479edf78 100644 --- a/openstack_dashboard/dashboards/admin/rbac_policies/urls.py +++ b/openstack_dashboard/dashboards/admin/rbac_policies/urls.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.admin.rbac_policies import views @@ -19,12 +19,12 @@ RBAC_POLICY_URL = r'^(?P[^/]+)/%s$' urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), - url(r'^create/$', views.CreateView.as_view(), name='create'), - url(RBAC_POLICY_URL % '$', - views.DetailView.as_view(), - name='detail'), - url(RBAC_POLICY_URL % 'update', - views.UpdateView.as_view(), - name='update'), + re_path(r'^$', views.IndexView.as_view(), name='index'), + re_path(r'^create/$', views.CreateView.as_view(), name='create'), + re_path(RBAC_POLICY_URL % '$', + views.DetailView.as_view(), + name='detail'), + re_path(RBAC_POLICY_URL % 'update', + views.UpdateView.as_view(), + name='update'), ] diff --git a/openstack_dashboard/dashboards/admin/routers/ports/urls.py b/openstack_dashboard/dashboards/admin/routers/ports/urls.py index fe785c49e6..816f91885d 100644 --- a/openstack_dashboard/dashboards/admin/routers/ports/urls.py +++ b/openstack_dashboard/dashboards/admin/routers/ports/urls.py @@ -12,12 +12,12 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.admin.routers.ports import views PORTS = r'^(?P[^/]+)/%s$' urlpatterns = [ - url(PORTS % 'detail', views.DetailView.as_view(), name='detail'), + re_path(PORTS % 'detail', views.DetailView.as_view(), name='detail'), ] diff --git a/openstack_dashboard/dashboards/admin/routers/urls.py b/openstack_dashboard/dashboards/admin/routers/urls.py index e2a600f280..7e1d16e200 100644 --- a/openstack_dashboard/dashboards/admin/routers/urls.py +++ b/openstack_dashboard/dashboards/admin/routers/urls.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.admin.routers import views @@ -21,15 +21,15 @@ ROUTER_URL = r'^(?P[^/]+)/%s' urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), - url(r'^create/$', views.CreateView.as_view(), name='create'), - url(ROUTER_URL % '$', - views.DetailView.as_view(), - name='detail'), - url(ROUTER_URL % 'update', - views.UpdateView.as_view(), - name='update'), - url(r'^(?P[^/]+)/l3_agent_list', - views.L3AgentView.as_view(), - name='l3_agent_list'), + re_path(r'^$', views.IndexView.as_view(), name='index'), + re_path(r'^create/$', views.CreateView.as_view(), name='create'), + re_path(ROUTER_URL % '$', + views.DetailView.as_view(), + name='detail'), + re_path(ROUTER_URL % 'update', + views.UpdateView.as_view(), + name='update'), + re_path(r'^(?P[^/]+)/l3_agent_list', + views.L3AgentView.as_view(), + name='l3_agent_list'), ] diff --git a/openstack_dashboard/dashboards/admin/snapshots/urls.py b/openstack_dashboard/dashboards/admin/snapshots/urls.py index d558ae9e34..5c6dd0b51f 100644 --- a/openstack_dashboard/dashboards/admin/snapshots/urls.py +++ b/openstack_dashboard/dashboards/admin/snapshots/urls.py @@ -10,17 +10,17 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.admin.snapshots import views urlpatterns = [ - url(r'^$', views.SnapshotsView.as_view(), name='index'), - url(r'^(?P[^/]+)$', - views.DetailView.as_view(), - name='detail'), - url(r'^(?P[^/]+)/update_status/$', - views.UpdateStatusView.as_view(), - name='update_status'), + re_path(r'^$', views.SnapshotsView.as_view(), name='index'), + re_path(r'^(?P[^/]+)$', + views.DetailView.as_view(), + name='detail'), + re_path(r'^(?P[^/]+)/update_status/$', + views.UpdateStatusView.as_view(), + name='update_status'), ] diff --git a/openstack_dashboard/dashboards/admin/trunks/urls.py b/openstack_dashboard/dashboards/admin/trunks/urls.py index 152e74ef40..229a860332 100644 --- a/openstack_dashboard/dashboards/admin/trunks/urls.py +++ b/openstack_dashboard/dashboards/admin/trunks/urls.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from django.utils.translation import gettext_lazy as _ from horizon.browsers.views import AngularIndexView @@ -20,7 +20,7 @@ from horizon.browsers.views import AngularIndexView title = _("Trunks") urlpatterns = [ - url(r'^$', AngularIndexView.as_view(title=title), name='index'), - url(r'^(?P[^/]+)/$', - AngularIndexView.as_view(title=title), name='detail'), + re_path(r'^$', AngularIndexView.as_view(title=title), name='index'), + re_path(r'^(?P[^/]+)/$', + AngularIndexView.as_view(title=title), name='detail'), ] diff --git a/openstack_dashboard/dashboards/admin/vg_snapshots/urls.py b/openstack_dashboard/dashboards/admin/vg_snapshots/urls.py index c8225143e1..5369a8df21 100644 --- a/openstack_dashboard/dashboards/admin/vg_snapshots/urls.py +++ b/openstack_dashboard/dashboards/admin/vg_snapshots/urls.py @@ -12,13 +12,13 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.admin.vg_snapshots import views urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), - url(r'^(?P[^/]+)/detail/$', - views.DetailView.as_view(), - name='detail'), + re_path(r'^$', views.IndexView.as_view(), name='index'), + re_path(r'^(?P[^/]+)/detail/$', + views.DetailView.as_view(), + name='detail'), ] diff --git a/openstack_dashboard/dashboards/admin/volume_groups/urls.py b/openstack_dashboard/dashboards/admin/volume_groups/urls.py index d34156626d..3d876d03c5 100644 --- a/openstack_dashboard/dashboards/admin/volume_groups/urls.py +++ b/openstack_dashboard/dashboards/admin/volume_groups/urls.py @@ -12,23 +12,23 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.admin.volume_groups import views urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), - url(r'^(?P[^/]+)$', - views.DetailView.as_view(), - name='detail'), - url(r'^(?P[^/]+)/remove_volumese/$', - views.RemoveVolumesView.as_view(), - name='remove_volumes'), - url(r'^(?P[^/]+)/delete/$', - views.DeleteView.as_view(), - name='delete'), - url(r'^(?P[^/]+)/manage/$', - views.ManageView.as_view(), - name='manage'), + re_path(r'^$', views.IndexView.as_view(), name='index'), + re_path(r'^(?P[^/]+)$', + views.DetailView.as_view(), + name='detail'), + re_path(r'^(?P[^/]+)/remove_volumese/$', + views.RemoveVolumesView.as_view(), + name='remove_volumes'), + re_path(r'^(?P[^/]+)/delete/$', + views.DeleteView.as_view(), + name='delete'), + re_path(r'^(?P[^/]+)/manage/$', + views.ManageView.as_view(), + name='manage'), ] diff --git a/openstack_dashboard/dashboards/admin/volume_types/extras/urls.py b/openstack_dashboard/dashboards/admin/volume_types/extras/urls.py index 3271c01680..443cbd350a 100644 --- a/openstack_dashboard/dashboards/admin/volume_types/extras/urls.py +++ b/openstack_dashboard/dashboards/admin/volume_types/extras/urls.py @@ -10,13 +10,13 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.admin.volume_types.extras \ import views urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), - url(r'^create/$', views.CreateView.as_view(), name='create'), - url(r'^(?P[^/]+)/edit/$', views.EditView.as_view(), name='edit'), + re_path(r'^$', views.IndexView.as_view(), name='index'), + re_path(r'^create/$', views.CreateView.as_view(), name='create'), + re_path(r'^(?P[^/]+)/edit/$', views.EditView.as_view(), name='edit'), ] diff --git a/openstack_dashboard/dashboards/admin/volume_types/qos_specs/urls.py b/openstack_dashboard/dashboards/admin/volume_types/qos_specs/urls.py index b0123fd505..d5756c1d78 100644 --- a/openstack_dashboard/dashboards/admin/volume_types/qos_specs/urls.py +++ b/openstack_dashboard/dashboards/admin/volume_types/qos_specs/urls.py @@ -10,15 +10,16 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.admin.volume_types.qos_specs \ import views urlpatterns = [ - url(r'^(?P[^/]+)/create/$', - views.CreateKeyValuePairView.as_view(), name='create'), - url(r'^(?P[^/]+)/$', views.IndexView.as_view(), name='index'), - url(r'^(?P[^/]+)/key/(?P[^/]+)/edit/$', - views.EditKeyValuePairView.as_view(), name='edit'), + re_path(r'^(?P[^/]+)/create/$', + views.CreateKeyValuePairView.as_view(), name='create'), + re_path(r'^(?P[^/]+)/$', + views.IndexView.as_view(), name='index'), + re_path(r'^(?P[^/]+)/key/(?P[^/]+)/edit/$', + views.EditKeyValuePairView.as_view(), name='edit'), ] diff --git a/openstack_dashboard/dashboards/admin/volume_types/urls.py b/openstack_dashboard/dashboards/admin/volume_types/urls.py index 43433cb386..868760236e 100644 --- a/openstack_dashboard/dashboards/admin/volume_types/urls.py +++ b/openstack_dashboard/dashboards/admin/volume_types/urls.py @@ -11,7 +11,7 @@ # under the License. from django.conf.urls import include -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.admin.volume_types.extras \ import urls as extras_urls @@ -22,33 +22,33 @@ from openstack_dashboard.dashboards.admin.volume_types \ urlpatterns = [ - url(r'^$', views.VolumeTypesView.as_view(), name='index'), - url(r'^create_type$', views.CreateVolumeTypeView.as_view(), - name='create_type'), - url(r'^(?P[^/]+)/update_type/$', - views.EditVolumeTypeView.as_view(), - name='update_type'), - url(r'^create_qos_spec$', views.CreateQosSpecView.as_view(), - name='create_qos_spec'), - url(r'^(?P[^/]+)/manage_qos_spec_association/$', - views.ManageQosSpecAssociationView.as_view(), - name='manage_qos_spec_association'), - url(r'^(?P[^/]+)/edit_qos_spec_consumer/$', - views.EditQosSpecConsumerView.as_view(), - name='edit_qos_spec_consumer'), - url(r'^(?P[^/]+)/extras/', - include((extras_urls, 'extras'))), - url(r'^(?P[^/]+)/create_type_encryption/$', - views.CreateVolumeTypeEncryptionView.as_view(), - name='create_type_encryption'), - url(r'^(?P[^/]+)/update_type_encryption/$', - views.UpdateVolumeTypeEncryptionView.as_view(), - name='update_type_encryption'), - url(r'^(?P[^/]+)/type_encryption_detail/$', - views.VolumeTypeEncryptionDetailView.as_view(), - name='type_encryption_detail'), - url(r'^qos_specs/', - include((qos_specs_urls, 'qos_specs'))), - url(r'^(?P[^/]+)/edit_access/$', - views.EditAccessView.as_view(), name='edit_access'), + re_path(r'^$', views.VolumeTypesView.as_view(), name='index'), + re_path(r'^create_type$', views.CreateVolumeTypeView.as_view(), + name='create_type'), + re_path(r'^(?P[^/]+)/update_type/$', + views.EditVolumeTypeView.as_view(), + name='update_type'), + re_path(r'^create_qos_spec$', views.CreateQosSpecView.as_view(), + name='create_qos_spec'), + re_path(r'^(?P[^/]+)/manage_qos_spec_association/$', + views.ManageQosSpecAssociationView.as_view(), + name='manage_qos_spec_association'), + re_path(r'^(?P[^/]+)/edit_qos_spec_consumer/$', + views.EditQosSpecConsumerView.as_view(), + name='edit_qos_spec_consumer'), + re_path(r'^(?P[^/]+)/extras/', + include((extras_urls, 'extras'))), + re_path(r'^(?P[^/]+)/create_type_encryption/$', + views.CreateVolumeTypeEncryptionView.as_view(), + name='create_type_encryption'), + re_path(r'^(?P[^/]+)/update_type_encryption/$', + views.UpdateVolumeTypeEncryptionView.as_view(), + name='update_type_encryption'), + re_path(r'^(?P[^/]+)/type_encryption_detail/$', + views.VolumeTypeEncryptionDetailView.as_view(), + name='type_encryption_detail'), + re_path(r'^qos_specs/', + include((qos_specs_urls, 'qos_specs'))), + re_path(r'^(?P[^/]+)/edit_access/$', + views.EditAccessView.as_view(), name='edit_access'), ] diff --git a/openstack_dashboard/dashboards/admin/volumes/urls.py b/openstack_dashboard/dashboards/admin/volumes/urls.py index 74ee26e819..55a192536c 100644 --- a/openstack_dashboard/dashboards/admin/volumes/urls.py +++ b/openstack_dashboard/dashboards/admin/volumes/urls.py @@ -10,28 +10,28 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.admin.volumes import views urlpatterns = [ - url(r'^$', - views.VolumesView.as_view(), - name='index'), - url(r'^manage/$', - views.ManageVolumeView.as_view(), - name='manage'), - url(r'^(?P[^/]+)/$', - views.DetailView.as_view(), - name='detail'), - url(r'^(?P[^/]+)/update_status$', - views.UpdateStatusView.as_view(), - name='update_status'), - url(r'^(?P[^/]+)/unmanage$', - views.UnmanageVolumeView.as_view(), - name='unmanage'), - url(r'^(?P[^/]+)/migrate$', - views.MigrateVolumeView.as_view(), - name='migrate'), + re_path(r'^$', + views.VolumesView.as_view(), + name='index'), + re_path(r'^manage/$', + views.ManageVolumeView.as_view(), + name='manage'), + re_path(r'^(?P[^/]+)/$', + views.DetailView.as_view(), + name='detail'), + re_path(r'^(?P[^/]+)/update_status$', + views.UpdateStatusView.as_view(), + name='update_status'), + re_path(r'^(?P[^/]+)/unmanage$', + views.UnmanageVolumeView.as_view(), + name='unmanage'), + re_path(r'^(?P[^/]+)/migrate$', + views.MigrateVolumeView.as_view(), + name='migrate'), ] diff --git a/openstack_dashboard/dashboards/identity/application_credentials/urls.py b/openstack_dashboard/dashboards/identity/application_credentials/urls.py index 24e3061db7..a3deb70ea0 100644 --- a/openstack_dashboard/dashboards/identity/application_credentials/urls.py +++ b/openstack_dashboard/dashboards/identity/application_credentials/urls.py @@ -13,23 +13,23 @@ # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.identity.application_credentials \ import views urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), - url(r'^create/$', views.CreateView.as_view(), name='create'), - url(r'^(?P[^/]+)/detail/$', - views.DetailView.as_view(), name='detail'), - url(r'^success/$', - views.CreateSuccessfulView.as_view(), name='success'), - url(r'^download_openrc/$', - views.download_rc_file, name='download_openrc'), - url(r'^download_kubeconfig/$', - views.download_kubeconfig_file, name='download_kubeconfig'), - url(r'^download_clouds_yaml/$', - views.download_clouds_yaml_file, name='download_clouds_yaml'), + re_path(r'^$', views.IndexView.as_view(), name='index'), + re_path(r'^create/$', views.CreateView.as_view(), name='create'), + re_path(r'^(?P[^/]+)/detail/$', + views.DetailView.as_view(), name='detail'), + re_path(r'^success/$', + views.CreateSuccessfulView.as_view(), name='success'), + re_path(r'^download_openrc/$', + views.download_rc_file, name='download_openrc'), + re_path(r'^download_kubeconfig/$', + views.download_kubeconfig_file, name='download_kubeconfig'), + re_path(r'^download_clouds_yaml/$', + views.download_clouds_yaml_file, name='download_clouds_yaml'), ] diff --git a/openstack_dashboard/dashboards/identity/domains/urls.py b/openstack_dashboard/dashboards/identity/domains/urls.py index 5489915874..c824338e1a 100644 --- a/openstack_dashboard/dashboards/identity/domains/urls.py +++ b/openstack_dashboard/dashboards/identity/domains/urls.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from django.utils.translation import gettext_lazy as _ from horizon.browsers import views @@ -24,12 +24,13 @@ from openstack_dashboard.utils import settings as setting_utils if setting_utils.get_dict_config('ANGULAR_FEATURES', 'domains_panel'): title = _("Domains") urlpatterns = [ - url('', views.AngularIndexView.as_view(title=title), name='index'), + re_path('', views.AngularIndexView.as_view(title=title), name='index'), ] else: urlpatterns = [ - url(r'^$', legacyView.IndexView.as_view(), name='index'), - url(r'^create$', legacyView.CreateDomainView.as_view(), name='create'), - url(r'^(?P[^/]+)/update/$', - legacyView.UpdateDomainView.as_view(), name='update') + re_path(r'^$', legacyView.IndexView.as_view(), name='index'), + re_path(r'^create$', + legacyView.CreateDomainView.as_view(), name='create'), + re_path(r'^(?P[^/]+)/update/$', + legacyView.UpdateDomainView.as_view(), name='update') ] diff --git a/openstack_dashboard/dashboards/identity/groups/urls.py b/openstack_dashboard/dashboards/identity/groups/urls.py index 45e74e8f2e..de5b671b11 100644 --- a/openstack_dashboard/dashboards/identity/groups/urls.py +++ b/openstack_dashboard/dashboards/identity/groups/urls.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from horizon.browsers.views import AngularIndexView @@ -24,16 +24,16 @@ from openstack_dashboard.utils import settings as setting_utils if setting_utils.get_dict_config('ANGULAR_FEATURES', 'groups_panel'): title = panel.Groups.name urlpatterns = [ - url(r'^$', AngularIndexView.as_view(title=title), name='index'), + re_path(r'^$', AngularIndexView.as_view(title=title), name='index'), ] else: urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), - url(r'^create$', views.CreateView.as_view(), name='create'), - url(r'^(?P[^/]+)/update/$', - views.UpdateView.as_view(), name='update'), - url(r'^(?P[^/]+)/manage_members/$', - views.ManageMembersView.as_view(), name='manage_members'), - url(r'^(?P[^/]+)/add_members/$', - views.NonMembersView.as_view(), name='add_members'), + re_path(r'^$', views.IndexView.as_view(), name='index'), + re_path(r'^create$', views.CreateView.as_view(), name='create'), + re_path(r'^(?P[^/]+)/update/$', + views.UpdateView.as_view(), name='update'), + re_path(r'^(?P[^/]+)/manage_members/$', + views.ManageMembersView.as_view(), name='manage_members'), + re_path(r'^(?P[^/]+)/add_members/$', + views.NonMembersView.as_view(), name='add_members'), ] diff --git a/openstack_dashboard/dashboards/identity/identity_providers/protocols/urls.py b/openstack_dashboard/dashboards/identity/identity_providers/protocols/urls.py index 8c1e5494f4..66e8899531 100644 --- a/openstack_dashboard/dashboards/identity/identity_providers/protocols/urls.py +++ b/openstack_dashboard/dashboards/identity/identity_providers/protocols/urls.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.identity.identity_providers.protocols \ import views @@ -20,5 +20,5 @@ from openstack_dashboard.dashboards.identity.identity_providers.protocols \ PORTS = r'^(?P[^/]+)/%s$' urlpatterns = [ - url(r'^create/$', views.AddProtocolView.as_view(), name='create'), + re_path(r'^create/$', views.AddProtocolView.as_view(), name='create'), ] diff --git a/openstack_dashboard/dashboards/identity/identity_providers/urls.py b/openstack_dashboard/dashboards/identity/identity_providers/urls.py index 8d6aa553ab..bf30e77244 100644 --- a/openstack_dashboard/dashboards/identity/identity_providers/urls.py +++ b/openstack_dashboard/dashboards/identity/identity_providers/urls.py @@ -13,7 +13,7 @@ # under the License. from django.conf.urls import include -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.identity.identity_providers.protocols \ import urls as protocol_urls @@ -21,16 +21,16 @@ from openstack_dashboard.dashboards.identity.identity_providers \ import views urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), - url(r'^(?P[^/]+)/detail/$', - views.DetailView.as_view(), name='detail'), - url(r'^(?P[^/]+)/detail/' - r'\?tab=idp_details__protocols$', - views.DetailView.as_view(), - name='protocols_tab'), - url(r'^(?P[^/]+)/update/$', - views.UpdateView.as_view(), name='update'), - url(r'^register/$', views.RegisterView.as_view(), name='register'), - url(r'(?P[^/]+)/protocols/', - include((protocol_urls, 'protocols'))), + re_path(r'^$', views.IndexView.as_view(), name='index'), + re_path(r'^(?P[^/]+)/detail/$', + views.DetailView.as_view(), name='detail'), + re_path(r'^(?P[^/]+)/detail/' + r'\?tab=idp_details__protocols$', + views.DetailView.as_view(), + name='protocols_tab'), + re_path(r'^(?P[^/]+)/update/$', + views.UpdateView.as_view(), name='update'), + re_path(r'^register/$', views.RegisterView.as_view(), name='register'), + re_path(r'(?P[^/]+)/protocols/', + include((protocol_urls, 'protocols'))), ] diff --git a/openstack_dashboard/dashboards/identity/mappings/urls.py b/openstack_dashboard/dashboards/identity/mappings/urls.py index 77a243e9e4..0a4631d36f 100644 --- a/openstack_dashboard/dashboards/identity/mappings/urls.py +++ b/openstack_dashboard/dashboards/identity/mappings/urls.py @@ -12,13 +12,13 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.identity.mappings import views urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), - url(r'^(?P[^/]+)/update/$', - views.UpdateView.as_view(), name='update'), - url(r'^create/$', views.CreateView.as_view(), name='create'), + re_path(r'^$', views.IndexView.as_view(), name='index'), + re_path(r'^(?P[^/]+)/update/$', + views.UpdateView.as_view(), name='update'), + re_path(r'^create/$', views.CreateView.as_view(), name='create'), ] diff --git a/openstack_dashboard/dashboards/identity/projects/urls.py b/openstack_dashboard/dashboards/identity/projects/urls.py index fa7a884786..f2dfc9dab9 100644 --- a/openstack_dashboard/dashboards/identity/projects/urls.py +++ b/openstack_dashboard/dashboards/identity/projects/urls.py @@ -16,20 +16,20 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.identity.projects import views urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), - url(r'^create$', views.CreateProjectView.as_view(), name='create'), - url(r'^(?P[^/]+)/update/$', - views.UpdateProjectView.as_view(), name='update'), - url(r'^(?P[^/]+)/usage/$', - views.ProjectUsageView.as_view(), name='usage'), - url(r'^(?P[^/]+)/detail/$', - views.DetailProjectView.as_view(), name='detail'), - url(r'^(?P[^/]+)/update_quotas/$', - views.UpdateQuotasView.as_view(), name='update_quotas'), + re_path(r'^$', views.IndexView.as_view(), name='index'), + re_path(r'^create$', views.CreateProjectView.as_view(), name='create'), + re_path(r'^(?P[^/]+)/update/$', + views.UpdateProjectView.as_view(), name='update'), + re_path(r'^(?P[^/]+)/usage/$', + views.ProjectUsageView.as_view(), name='usage'), + re_path(r'^(?P[^/]+)/detail/$', + views.DetailProjectView.as_view(), name='detail'), + re_path(r'^(?P[^/]+)/update_quotas/$', + views.UpdateQuotasView.as_view(), name='update_quotas'), ] diff --git a/openstack_dashboard/dashboards/identity/roles/urls.py b/openstack_dashboard/dashboards/identity/roles/urls.py index 9c8a719bc7..e0453caca6 100644 --- a/openstack_dashboard/dashboards/identity/roles/urls.py +++ b/openstack_dashboard/dashboards/identity/roles/urls.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from django.utils.translation import gettext_lazy as _ from horizon.browsers.views import AngularIndexView @@ -24,12 +24,12 @@ if setting_utils.get_dict_config('ANGULAR_FEATURES', 'roles_panel'): # New angular panel title = _('Roles') urlpatterns = [ - url(r'^$', AngularIndexView.as_view(title=title), name='index'), + re_path(r'^$', AngularIndexView.as_view(title=title), name='index'), ] else: urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), - url(r'^(?P[^/]+)/update/$', - views.UpdateView.as_view(), name='update'), - url(r'^create/$', views.CreateView.as_view(), name='create'), + re_path(r'^$', views.IndexView.as_view(), name='index'), + re_path(r'^(?P[^/]+)/update/$', + views.UpdateView.as_view(), name='update'), + re_path(r'^create/$', views.CreateView.as_view(), name='create'), ] diff --git a/openstack_dashboard/dashboards/identity/users/urls.py b/openstack_dashboard/dashboards/identity/users/urls.py index 82f5f166ab..1b99c0422f 100644 --- a/openstack_dashboard/dashboards/identity/users/urls.py +++ b/openstack_dashboard/dashboards/identity/users/urls.py @@ -16,7 +16,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from django.utils.translation import gettext_lazy as _ from horizon.browsers.views import AngularIndexView @@ -28,16 +28,16 @@ if setting_utils.get_dict_config('ANGULAR_FEATURES', 'users_panel'): title = _("Users") # new angular panel urlpatterns = [ - url(r'^$', AngularIndexView.as_view(title=title), name='index'), + re_path(r'^$', AngularIndexView.as_view(title=title), name='index'), ] else: urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), - url(r'^(?P[^/]+)/update/$', - views.UpdateView.as_view(), name='update'), - url(r'^create/$', views.CreateView.as_view(), name='create'), - url(r'^(?P[^/]+)/detail/$', - views.DetailView.as_view(), name='detail'), - url(r'^(?P[^/]+)/change_password/$', - views.ChangePasswordView.as_view(), name='change_password'), + re_path(r'^$', views.IndexView.as_view(), name='index'), + re_path(r'^(?P[^/]+)/update/$', + views.UpdateView.as_view(), name='update'), + re_path(r'^create/$', views.CreateView.as_view(), name='create'), + re_path(r'^(?P[^/]+)/detail/$', + views.DetailView.as_view(), name='detail'), + re_path(r'^(?P[^/]+)/change_password/$', + views.ChangePasswordView.as_view(), name='change_password'), ] diff --git a/openstack_dashboard/dashboards/project/api_access/urls.py b/openstack_dashboard/dashboards/project/api_access/urls.py index dc0879a0f1..e07fef5063 100644 --- a/openstack_dashboard/dashboards/project/api_access/urls.py +++ b/openstack_dashboard/dashboards/project/api_access/urls.py @@ -16,18 +16,19 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.project.api_access import views urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), - url(r'^ec2/$', views.download_ec2_bundle, name='ec2'), - url(r'^clouds.yaml/$', - views.download_clouds_yaml_file, name='clouds.yaml'), - url(r'^openrc/$', views.download_rc_file, name='openrc'), - url(r'^view_credentials/$', views.CredentialsView.as_view(), - name='view_credentials'), - url(r'^recreate_ec2_credentials/$', - views.RecreateCredentialsView.as_view(), name='recreate_credentials'), + re_path(r'^$', views.IndexView.as_view(), name='index'), + re_path(r'^ec2/$', views.download_ec2_bundle, name='ec2'), + re_path(r'^clouds.yaml/$', + views.download_clouds_yaml_file, name='clouds.yaml'), + re_path(r'^openrc/$', views.download_rc_file, name='openrc'), + re_path(r'^view_credentials/$', views.CredentialsView.as_view(), + name='view_credentials'), + re_path(r'^recreate_ec2_credentials/$', + views.RecreateCredentialsView.as_view(), + name='recreate_credentials'), ] diff --git a/openstack_dashboard/dashboards/project/backups/urls.py b/openstack_dashboard/dashboards/project/backups/urls.py index 77800a1705..6671589962 100644 --- a/openstack_dashboard/dashboards/project/backups/urls.py +++ b/openstack_dashboard/dashboards/project/backups/urls.py @@ -10,17 +10,17 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.project.backups import views urlpatterns = [ - url(r'^$', views.BackupsView.as_view(), name='index'), - url(r'^(?P[^/]+)/$', - views.BackupDetailView.as_view(), - name='detail'), - url(r'^(?P[^/]+)/restore/$', - views.RestoreBackupView.as_view(), - name='restore'), + re_path(r'^$', views.BackupsView.as_view(), name='index'), + re_path(r'^(?P[^/]+)/$', + views.BackupDetailView.as_view(), + name='detail'), + re_path(r'^(?P[^/]+)/restore/$', + views.RestoreBackupView.as_view(), + name='restore'), ] diff --git a/openstack_dashboard/dashboards/project/containers/urls.py b/openstack_dashboard/dashboards/project/containers/urls.py index ca3a504528..260f7e3b22 100644 --- a/openstack_dashboard/dashboards/project/containers/urls.py +++ b/openstack_dashboard/dashboards/project/containers/urls.py @@ -16,14 +16,14 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.project.containers import views urlpatterns = [ - url(r'^container/((?P.+?)/)?' - '(?P.+)?$', - views.NgIndexView.as_view(), name='index'), - url(r'^$', - views.NgIndexView.as_view(), name='index') + re_path(r'^container/((?P.+?)/)?' + '(?P.+)?$', + views.NgIndexView.as_view(), name='index'), + re_path(r'^$', + views.NgIndexView.as_view(), name='index') ] diff --git a/openstack_dashboard/dashboards/project/floating_ips/urls.py b/openstack_dashboard/dashboards/project/floating_ips/urls.py index 5d7ca61826..1b58738285 100644 --- a/openstack_dashboard/dashboards/project/floating_ips/urls.py +++ b/openstack_dashboard/dashboards/project/floating_ips/urls.py @@ -16,12 +16,12 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.project.floating_ips import views urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), - url(r'^associate/$', views.AssociateView.as_view(), name='associate'), - url(r'^allocate/$', views.AllocateView.as_view(), name='allocate'), + re_path(r'^$', views.IndexView.as_view(), name='index'), + re_path(r'^associate/$', views.AssociateView.as_view(), name='associate'), + re_path(r'^allocate/$', views.AllocateView.as_view(), name='allocate'), ] diff --git a/openstack_dashboard/dashboards/project/images/images/urls.py b/openstack_dashboard/dashboards/project/images/images/urls.py index 4a3685296e..6d86f7881f 100644 --- a/openstack_dashboard/dashboards/project/images/images/urls.py +++ b/openstack_dashboard/dashboards/project/images/images/urls.py @@ -16,7 +16,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from django.utils.translation import gettext_lazy as _ from horizon.browsers.views import AngularIndexView @@ -27,14 +27,15 @@ from openstack_dashboard.utils import settings as setting_utils if setting_utils.get_dict_config('ANGULAR_FEATURES', 'images_panel'): title = _("Images") urlpatterns = [ - url(r'^(?P[^/]+)/$', AngularIndexView.as_view(title=title), - name='detail'), + re_path(r'^(?P[^/]+)/$', + AngularIndexView.as_view(title=title), + name='detail'), ] else: urlpatterns = [ - url(r'^create/$', views.CreateView.as_view(), name='create'), - url(r'^(?P[^/]+)/update/$', - views.UpdateView.as_view(), name='update'), - url(r'^(?P[^/]+)/$', views.DetailView.as_view(), - name='detail'), + re_path(r'^create/$', views.CreateView.as_view(), name='create'), + re_path(r'^(?P[^/]+)/update/$', + views.UpdateView.as_view(), name='update'), + re_path(r'^(?P[^/]+)/$', views.DetailView.as_view(), + name='detail'), ] diff --git a/openstack_dashboard/dashboards/project/images/snapshots/urls.py b/openstack_dashboard/dashboards/project/images/snapshots/urls.py index 45885813ee..ad7cd753f4 100644 --- a/openstack_dashboard/dashboards/project/images/snapshots/urls.py +++ b/openstack_dashboard/dashboards/project/images/snapshots/urls.py @@ -16,13 +16,13 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.project.images.snapshots import views urlpatterns = [ - url(r'^(?P[^/]+)/create/$', - views.CreateView.as_view(), - name='create') + re_path(r'^(?P[^/]+)/create/$', + views.CreateView.as_view(), + name='create') ] diff --git a/openstack_dashboard/dashboards/project/images/urls.py b/openstack_dashboard/dashboards/project/images/urls.py index 8b0e300040..acda7c865e 100644 --- a/openstack_dashboard/dashboards/project/images/urls.py +++ b/openstack_dashboard/dashboards/project/images/urls.py @@ -17,7 +17,7 @@ # under the License. from django.conf.urls import include -from django.conf.urls import url +from django.urls import re_path from django.utils.translation import gettext_lazy as _ from horizon.browsers.views import AngularIndexView @@ -33,13 +33,13 @@ if setting_utils.get_dict_config('ANGULAR_FEATURES', 'images_panel'): title = _("Images") # New angular images urlpatterns = [ - url(r'^$', AngularIndexView.as_view(title=title), name='index'), - url(r'', include((image_urls, 'images'))), - url(r'', include((snapshot_urls, 'snapshots'))), + re_path(r'^$', AngularIndexView.as_view(title=title), name='index'), + re_path(r'', include((image_urls, 'images'))), + re_path(r'', include((snapshot_urls, 'snapshots'))), ] else: urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), - url(r'', include((image_urls, 'images'))), - url(r'', include((snapshot_urls, 'snapshots'))), + re_path(r'^$', views.IndexView.as_view(), name='index'), + re_path(r'', include((image_urls, 'images'))), + re_path(r'', include((snapshot_urls, 'snapshots'))), ] diff --git a/openstack_dashboard/dashboards/project/instances/urls.py b/openstack_dashboard/dashboards/project/instances/urls.py index 7d76c3ef82..dd35311ae3 100644 --- a/openstack_dashboard/dashboards/project/instances/urls.py +++ b/openstack_dashboard/dashboards/project/instances/urls.py @@ -16,7 +16,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.project.instances import views @@ -25,36 +25,35 @@ INSTANCES = r'^(?P[^/]+)/%s$' INSTANCES_KEYPAIR = r'^(?P[^/]+)/(?P[^/]+)/%s$' urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), - url(r'^(?P[^/]+)/$', - views.DetailView.as_view(), name='detail'), - url(INSTANCES % 'update', views.UpdateView.as_view(), name='update'), - url(INSTANCES % 'rebuild', views.RebuildView.as_view(), name='rebuild'), - url(INSTANCES % 'serial', views.SerialConsoleView.as_view(), - name='serial'), - url(INSTANCES % 'console', views.console, name='console'), - url(INSTANCES % 'auto_console', views.auto_console, name='auto_console'), - url(INSTANCES % 'vnc', views.vnc, name='vnc'), - url(INSTANCES % 'spice', views.spice, name='spice'), - url(INSTANCES % 'rdp', views.rdp, name='rdp'), - url(INSTANCES % 'resize', views.ResizeView.as_view(), name='resize'), - url(INSTANCES_KEYPAIR % 'decryptpassword', - views.DecryptPasswordView.as_view(), name='decryptpassword'), - url(INSTANCES % 'disassociate', - views.DisassociateView.as_view(), name='disassociate'), - url(INSTANCES % 'attach_interface', - views.AttachInterfaceView.as_view(), name='attach_interface'), - url(INSTANCES % 'detach_interface', - views.DetachInterfaceView.as_view(), name='detach_interface'), - url(r'^(?P[^/]+)/attach_volume/$', - views.AttachVolumeView.as_view(), - name='attach_volume' - ), - url(r'^(?P[^/]+)/detach_volume/$', - views.DetachVolumeView.as_view(), - name='detach_volume' - ), - url(r'^(?P[^/]+)/ports/(?P[^/]+)/update$', - views.UpdatePortView.as_view(), name='update_port'), - url(INSTANCES % 'rescue', views.RescueView.as_view(), name='rescue'), + re_path(r'^$', views.IndexView.as_view(), name='index'), + re_path(r'^(?P[^/]+)/$', + views.DetailView.as_view(), name='detail'), + re_path(INSTANCES % 'update', views.UpdateView.as_view(), name='update'), + re_path(INSTANCES % 'rebuild', views.RebuildView.as_view(), name='rebuild'), + re_path(INSTANCES % 'serial', views.SerialConsoleView.as_view(), + name='serial'), + re_path(INSTANCES % 'console', views.console, name='console'), + re_path(INSTANCES % 'auto_console', + views.auto_console, name='auto_console'), + re_path(INSTANCES % 'vnc', views.vnc, name='vnc'), + re_path(INSTANCES % 'spice', views.spice, name='spice'), + re_path(INSTANCES % 'rdp', views.rdp, name='rdp'), + re_path(INSTANCES % 'resize', views.ResizeView.as_view(), name='resize'), + re_path(INSTANCES_KEYPAIR % 'decryptpassword', + views.DecryptPasswordView.as_view(), name='decryptpassword'), + re_path(INSTANCES % 'disassociate', + views.DisassociateView.as_view(), name='disassociate'), + re_path(INSTANCES % 'attach_interface', + views.AttachInterfaceView.as_view(), name='attach_interface'), + re_path(INSTANCES % 'detach_interface', + views.DetachInterfaceView.as_view(), name='detach_interface'), + re_path(r'^(?P[^/]+)/attach_volume/$', + views.AttachVolumeView.as_view(), + name='attach_volume'), + re_path(r'^(?P[^/]+)/detach_volume/$', + views.DetachVolumeView.as_view(), + name='detach_volume'), + re_path(r'^(?P[^/]+)/ports/(?P[^/]+)/update$', + views.UpdatePortView.as_view(), name='update_port'), + re_path(INSTANCES % 'rescue', views.RescueView.as_view(), name='rescue'), ] diff --git a/openstack_dashboard/dashboards/project/key_pairs/urls.py b/openstack_dashboard/dashboards/project/key_pairs/urls.py index 139f2ffb95..d6f95f51d2 100644 --- a/openstack_dashboard/dashboards/project/key_pairs/urls.py +++ b/openstack_dashboard/dashboards/project/key_pairs/urls.py @@ -16,7 +16,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from django.utils.translation import gettext_lazy as _ from horizon.browsers import views @@ -27,15 +27,16 @@ from openstack_dashboard.utils import settings as setting_utils if setting_utils.get_dict_config('ANGULAR_FEATURES', 'key_pairs_panel'): title = _("Key Pairs") urlpatterns = [ - url('', views.AngularIndexView.as_view(title=title), name='index'), - url(r'^(?P[^/]+)/$', - views.AngularIndexView.as_view(title=title), - name='detail'), + re_path('', views.AngularIndexView.as_view(title=title), name='index'), + re_path(r'^(?P[^/]+)/$', + views.AngularIndexView.as_view(title=title), + name='detail'), ] else: urlpatterns = [ - url(r'^$', legacy_views.IndexView.as_view(), name='index'), - url(r'^import/$', legacy_views.ImportView.as_view(), name='import'), - url(r'^(?P[^/]+)/$', legacy_views.DetailView.as_view(), - name='detail'), + re_path(r'^$', legacy_views.IndexView.as_view(), name='index'), + re_path(r'^import/$', legacy_views.ImportView.as_view(), name='import'), + re_path(r'^(?P[^/]+)/$', + legacy_views.DetailView.as_view(), + name='detail'), ] diff --git a/openstack_dashboard/dashboards/project/network_qos/urls.py b/openstack_dashboard/dashboards/project/network_qos/urls.py index 0937bafd69..f62e1f4386 100644 --- a/openstack_dashboard/dashboards/project/network_qos/urls.py +++ b/openstack_dashboard/dashboards/project/network_qos/urls.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from django.utils.translation import gettext_lazy as _ from horizon.browsers import views @@ -18,5 +18,5 @@ from horizon.browsers import views title = _("Network QoS Policies") urlpatterns = [ - url(r'^$', views.AngularIndexView.as_view(title=title), name='index'), + re_path(r'^$', views.AngularIndexView.as_view(title=title), name='index'), ] diff --git a/openstack_dashboard/dashboards/project/network_topology/urls.py b/openstack_dashboard/dashboards/project/network_topology/urls.py index 1482294fe6..0e6895bc77 100644 --- a/openstack_dashboard/dashboards/project/network_topology/urls.py +++ b/openstack_dashboard/dashboards/project/network_topology/urls.py @@ -16,27 +16,29 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.project.network_topology import views urlpatterns = [ - url(r'^$', views.NetworkTopologyView.as_view(), name='index'), - url(r'^router$', views.RouterView.as_view(), name='router'), - url(r'^network$', views.NetworkView.as_view(), name='network'), - url(r'^instance$', views.InstanceView.as_view(), name='instance'), - url(r'^router/(?P[^/]+)/$', views.RouterDetailView.as_view(), - name='detail'), - url(r'^router/(?P[^/]+)/addinterface$', - views.NTAddInterfaceView.as_view(), name='interface'), - url(r'^network/(?P[^/]+)/$', views.NetworkDetailView.as_view(), - name='detail'), - url(r'^network/(?P[^/]+)/subnet/create$', - views.NTCreateSubnetView.as_view(), name='subnet'), - url(r'^json$', views.JSONView.as_view(), name='json'), - url(r'^createnetwork$', views.NTCreateNetworkView.as_view(), - name='createnetwork'), - url(r'^createrouter$', views.NTCreateRouterView.as_view(), - name='createrouter'), + re_path(r'^$', views.NetworkTopologyView.as_view(), name='index'), + re_path(r'^router$', views.RouterView.as_view(), name='router'), + re_path(r'^network$', views.NetworkView.as_view(), name='network'), + re_path(r'^instance$', views.InstanceView.as_view(), name='instance'), + re_path(r'^router/(?P[^/]+)/$', + views.RouterDetailView.as_view(), + name='detail'), + re_path(r'^router/(?P[^/]+)/addinterface$', + views.NTAddInterfaceView.as_view(), name='interface'), + re_path(r'^network/(?P[^/]+)/$', + views.NetworkDetailView.as_view(), + name='detail'), + re_path(r'^network/(?P[^/]+)/subnet/create$', + views.NTCreateSubnetView.as_view(), name='subnet'), + re_path(r'^json$', views.JSONView.as_view(), name='json'), + re_path(r'^createnetwork$', views.NTCreateNetworkView.as_view(), + name='createnetwork'), + re_path(r'^createrouter$', views.NTCreateRouterView.as_view(), + name='createrouter'), ] diff --git a/openstack_dashboard/dashboards/project/networks/ports/urls.py b/openstack_dashboard/dashboards/project/networks/ports/urls.py index 77f019e775..0d7ec4882d 100644 --- a/openstack_dashboard/dashboards/project/networks/ports/urls.py +++ b/openstack_dashboard/dashboards/project/networks/ports/urls.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.project.networks.ports import views from openstack_dashboard.dashboards.project.networks.ports.extensions. \ @@ -22,8 +22,8 @@ from openstack_dashboard.dashboards.project.networks.ports.extensions. \ PORTS = r'^(?P[^/]+)/%s$' urlpatterns = [ - url(PORTS % 'detail', views.DetailView.as_view(), name='detail'), - url(PORTS % 'addallowedaddresspairs', - addr_pairs_views.AddAllowedAddressPair.as_view(), - name='addallowedaddresspairs') + re_path(PORTS % 'detail', views.DetailView.as_view(), name='detail'), + re_path(PORTS % 'addallowedaddresspairs', + addr_pairs_views.AddAllowedAddressPair.as_view(), + name='addallowedaddresspairs') ] diff --git a/openstack_dashboard/dashboards/project/networks/subnets/urls.py b/openstack_dashboard/dashboards/project/networks/subnets/urls.py index 8f187d6f76..3fb3c4a309 100644 --- a/openstack_dashboard/dashboards/project/networks/subnets/urls.py +++ b/openstack_dashboard/dashboards/project/networks/subnets/urls.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.project.networks.subnets import views @@ -20,5 +20,5 @@ from openstack_dashboard.dashboards.project.networks.subnets import views SUBNETS = r'^(?P[^/]+)/%s$' urlpatterns = [ - url(SUBNETS % 'detail', views.DetailView.as_view(), name='detail'), + re_path(SUBNETS % 'detail', views.DetailView.as_view(), name='detail'), ] diff --git a/openstack_dashboard/dashboards/project/networks/urls.py b/openstack_dashboard/dashboards/project/networks/urls.py index 8b7ba019d1..904f9842da 100644 --- a/openstack_dashboard/dashboards/project/networks/urls.py +++ b/openstack_dashboard/dashboards/project/networks/urls.py @@ -13,7 +13,7 @@ # under the License. from django.conf.urls import include -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.project.networks.ports \ import urls as port_urls @@ -30,24 +30,24 @@ NETWORKS = r'^(?P[^/]+)/%s$' urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), - url(r'^create$', views.CreateView.as_view(), name='create'), - url(NETWORKS % r'detail(\?tab=network_tabs__overview)?$', - views.DetailView.as_view(), - name='detail'), - url(NETWORKS % r'detail\?tab=network_tabs__ports_tab$', - views.DetailView.as_view(), name='ports_tab'), - url(NETWORKS % r'detail\?tab=network_tabs__subnets_tab$', - views.DetailView.as_view(), name='subnets_tab'), - url(NETWORKS % 'update', views.UpdateView.as_view(), name='update'), - url(NETWORKS % 'subnets/create', subnet_views.CreateView.as_view(), - name='createsubnet'), - url(NETWORKS % 'ports/create', - port_views.CreateView.as_view(), name='addport'), - url(r'^(?P[^/]+)/subnets/(?P[^/]+)/update$', - subnet_views.UpdateView.as_view(), name='editsubnet'), - url(r'^(?P[^/]+)/ports/(?P[^/]+)/update$', - port_views.UpdateView.as_view(), name='editport'), - url(r'^subnets/', include((subnet_urls, 'subnets'))), - url(r'^ports/', include((port_urls, 'ports'))), + re_path(r'^$', views.IndexView.as_view(), name='index'), + re_path(r'^create$', views.CreateView.as_view(), name='create'), + re_path(NETWORKS % r'detail(\?tab=network_tabs__overview)?$', + views.DetailView.as_view(), + name='detail'), + re_path(NETWORKS % r'detail\?tab=network_tabs__ports_tab$', + views.DetailView.as_view(), name='ports_tab'), + re_path(NETWORKS % r'detail\?tab=network_tabs__subnets_tab$', + views.DetailView.as_view(), name='subnets_tab'), + re_path(NETWORKS % 'update', views.UpdateView.as_view(), name='update'), + re_path(NETWORKS % 'subnets/create', subnet_views.CreateView.as_view(), + name='createsubnet'), + re_path(NETWORKS % 'ports/create', + port_views.CreateView.as_view(), name='addport'), + re_path(r'^(?P[^/]+)/subnets/(?P[^/]+)/update$', + subnet_views.UpdateView.as_view(), name='editsubnet'), + re_path(r'^(?P[^/]+)/ports/(?P[^/]+)/update$', + port_views.UpdateView.as_view(), name='editport'), + re_path(r'^subnets/', include((subnet_urls, 'subnets'))), + re_path(r'^ports/', include((port_urls, 'ports'))), ] diff --git a/openstack_dashboard/dashboards/project/overview/urls.py b/openstack_dashboard/dashboards/project/overview/urls.py index f70a943762..f0fd99485a 100644 --- a/openstack_dashboard/dashboards/project/overview/urls.py +++ b/openstack_dashboard/dashboards/project/overview/urls.py @@ -16,12 +16,12 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.project.overview import views urlpatterns = [ - url(r'^$', views.ProjectOverview.as_view(), name='index'), - url(r'^warning$', views.WarningView.as_view(), name='warning'), + re_path(r'^$', views.ProjectOverview.as_view(), name='index'), + re_path(r'^warning$', views.WarningView.as_view(), name='warning'), ] diff --git a/openstack_dashboard/dashboards/project/routers/ports/urls.py b/openstack_dashboard/dashboards/project/routers/ports/urls.py index 30904c00a7..62d7215e94 100644 --- a/openstack_dashboard/dashboards/project/routers/ports/urls.py +++ b/openstack_dashboard/dashboards/project/routers/ports/urls.py @@ -12,12 +12,12 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.project.routers.ports import views PORTS = r'^(?P[^/]+)/%s$' urlpatterns = [ - url(PORTS % 'detail', views.DetailView.as_view(), name='detail'), + re_path(PORTS % 'detail', views.DetailView.as_view(), name='detail'), ] diff --git a/openstack_dashboard/dashboards/project/routers/urls.py b/openstack_dashboard/dashboards/project/routers/urls.py index 40ac695cdf..53b1383c11 100644 --- a/openstack_dashboard/dashboards/project/routers/urls.py +++ b/openstack_dashboard/dashboards/project/routers/urls.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.project.routers.extensions.extraroutes\ import views as er_views @@ -25,21 +25,21 @@ ROUTER_URL = r'^(?P[^/]+)/%s' urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), - url(r'^create/$', views.CreateView.as_view(), name='create'), - url(ROUTER_URL % '$', - views.DetailView.as_view(), - name='detail'), - url(ROUTER_URL % 'update', - views.UpdateView.as_view(), - name='update'), - url(ROUTER_URL % 'addinterface', - port_views.AddInterfaceView.as_view(), - name='addinterface'), - url(ROUTER_URL % 'addrouterroute', - er_views.AddRouterRouteView.as_view(), - name='addrouterroute'), - url(ROUTER_URL % 'setgateway', - port_views.SetGatewayView.as_view(), - name='setgateway'), + re_path(r'^$', views.IndexView.as_view(), name='index'), + re_path(r'^create/$', views.CreateView.as_view(), name='create'), + re_path(ROUTER_URL % '$', + views.DetailView.as_view(), + name='detail'), + re_path(ROUTER_URL % 'update', + views.UpdateView.as_view(), + name='update'), + re_path(ROUTER_URL % 'addinterface', + port_views.AddInterfaceView.as_view(), + name='addinterface'), + re_path(ROUTER_URL % 'addrouterroute', + er_views.AddRouterRouteView.as_view(), + name='addrouterroute'), + re_path(ROUTER_URL % 'setgateway', + port_views.SetGatewayView.as_view(), + name='setgateway'), ] diff --git a/openstack_dashboard/dashboards/project/security_groups/urls.py b/openstack_dashboard/dashboards/project/security_groups/urls.py index fc1e77a2d2..4aa1f6161e 100644 --- a/openstack_dashboard/dashboards/project/security_groups/urls.py +++ b/openstack_dashboard/dashboards/project/security_groups/urls.py @@ -16,20 +16,20 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.project.security_groups import views urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), - url(r'^create/$', views.CreateView.as_view(), name='create'), - url(r'^(?P[^/]+)/$', - views.DetailView.as_view(), - name='detail'), - url(r'^(?P[^/]+)/add_rule/$', - views.AddRuleView.as_view(), - name='add_rule'), - url(r'^(?P[^/]+)/update/$', - views.UpdateView.as_view(), - name='update') + re_path(r'^$', views.IndexView.as_view(), name='index'), + re_path(r'^create/$', views.CreateView.as_view(), name='create'), + re_path(r'^(?P[^/]+)/$', + views.DetailView.as_view(), + name='detail'), + re_path(r'^(?P[^/]+)/add_rule/$', + views.AddRuleView.as_view(), + name='add_rule'), + re_path(r'^(?P[^/]+)/update/$', + views.UpdateView.as_view(), + name='update') ] diff --git a/openstack_dashboard/dashboards/project/server_groups/urls.py b/openstack_dashboard/dashboards/project/server_groups/urls.py index fb489abecb..1b65e2e3db 100644 --- a/openstack_dashboard/dashboards/project/server_groups/urls.py +++ b/openstack_dashboard/dashboards/project/server_groups/urls.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from django.utils.translation import gettext_lazy as _ from horizon.browsers import views @@ -18,5 +18,5 @@ from horizon.browsers import views title = _("Server Groups") urlpatterns = [ - url(r'^$', views.AngularIndexView.as_view(title=title), name='index'), + re_path(r'^$', views.AngularIndexView.as_view(title=title), name='index'), ] diff --git a/openstack_dashboard/dashboards/project/snapshots/urls.py b/openstack_dashboard/dashboards/project/snapshots/urls.py index 2f0ed0c615..961ca03fcc 100644 --- a/openstack_dashboard/dashboards/project/snapshots/urls.py +++ b/openstack_dashboard/dashboards/project/snapshots/urls.py @@ -10,17 +10,17 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.project.snapshots import views urlpatterns = [ - url(r'^$', views.SnapshotsView.as_view(), name='index'), - url(r'^(?P[^/]+)$', - views.DetailView.as_view(), - name='detail'), - url(r'^(?P[^/]+)/update/$', - views.UpdateView.as_view(), - name='update'), + re_path(r'^$', views.SnapshotsView.as_view(), name='index'), + re_path(r'^(?P[^/]+)$', + views.DetailView.as_view(), + name='detail'), + re_path(r'^(?P[^/]+)/update/$', + views.UpdateView.as_view(), + name='update'), ] diff --git a/openstack_dashboard/dashboards/project/trunks/urls.py b/openstack_dashboard/dashboards/project/trunks/urls.py index cb49c98290..8b460d6fbe 100644 --- a/openstack_dashboard/dashboards/project/trunks/urls.py +++ b/openstack_dashboard/dashboards/project/trunks/urls.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from django.utils.translation import gettext_lazy as _ from horizon.browsers.views import AngularIndexView @@ -20,7 +20,7 @@ from horizon.browsers.views import AngularIndexView title = _("Trunks") urlpatterns = [ - url(r'^$', AngularIndexView.as_view(title=title), name='index'), - url(r'^(?P[^/]+)/$', AngularIndexView.as_view(title=title), - name='detail'), + re_path(r'^$', AngularIndexView.as_view(title=title), name='index'), + re_path(r'^(?P[^/]+)/$', AngularIndexView.as_view(title=title), + name='detail'), ] diff --git a/openstack_dashboard/dashboards/project/vg_snapshots/urls.py b/openstack_dashboard/dashboards/project/vg_snapshots/urls.py index 859547ffab..b969093bc9 100644 --- a/openstack_dashboard/dashboards/project/vg_snapshots/urls.py +++ b/openstack_dashboard/dashboards/project/vg_snapshots/urls.py @@ -10,16 +10,16 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.project.vg_snapshots import views urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), - url(r'^(?P[^/]+)/detail/$', - views.DetailView.as_view(), - name='detail'), - url(r'^(?P[^/]+)/create_group/$', - views.CreateGroupView.as_view(), - name='create_group'), + re_path(r'^$', views.IndexView.as_view(), name='index'), + re_path(r'^(?P[^/]+)/detail/$', + views.DetailView.as_view(), + name='detail'), + re_path(r'^(?P[^/]+)/create_group/$', + views.CreateGroupView.as_view(), + name='create_group'), ] diff --git a/openstack_dashboard/dashboards/project/volume_groups/urls.py b/openstack_dashboard/dashboards/project/volume_groups/urls.py index 2ffdff972e..cf035f8a87 100644 --- a/openstack_dashboard/dashboards/project/volume_groups/urls.py +++ b/openstack_dashboard/dashboards/project/volume_groups/urls.py @@ -10,35 +10,35 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.project.volume_groups import views urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), - url(r'^(?P[^/]+)$', - views.DetailView.as_view(), - name='detail'), - url(r'^create/$', - views.CreateView.as_view(), - name='create'), - url(r'^(?P[^/]+)/update/$', - views.UpdateView.as_view(), - name='update'), - url(r'^(?P[^/]+)/remove_volumese/$', - views.RemoveVolumesView.as_view(), - name='remove_volumes'), - url(r'^(?P[^/]+)/delete/$', - views.DeleteView.as_view(), - name='delete'), - url(r'^(?P[^/]+)/manage/$', - views.ManageView.as_view(), - name='manage'), - url(r'^(?P[^/]+)/create_snapshot/$', - views.CreateSnapshotView.as_view(), - name='create_snapshot'), - url(r'^(?P[^/]+)/clone_group/$', - views.CloneGroupView.as_view(), - name='clone_group'), + re_path(r'^$', views.IndexView.as_view(), name='index'), + re_path(r'^(?P[^/]+)$', + views.DetailView.as_view(), + name='detail'), + re_path(r'^create/$', + views.CreateView.as_view(), + name='create'), + re_path(r'^(?P[^/]+)/update/$', + views.UpdateView.as_view(), + name='update'), + re_path(r'^(?P[^/]+)/remove_volumese/$', + views.RemoveVolumesView.as_view(), + name='remove_volumes'), + re_path(r'^(?P[^/]+)/delete/$', + views.DeleteView.as_view(), + name='delete'), + re_path(r'^(?P[^/]+)/manage/$', + views.ManageView.as_view(), + name='manage'), + re_path(r'^(?P[^/]+)/create_snapshot/$', + views.CreateSnapshotView.as_view(), + name='create_snapshot'), + re_path(r'^(?P[^/]+)/clone_group/$', + views.CloneGroupView.as_view(), + name='clone_group'), ] diff --git a/openstack_dashboard/dashboards/project/volumes/urls.py b/openstack_dashboard/dashboards/project/volumes/urls.py index 98bbd61e98..47555bf498 100644 --- a/openstack_dashboard/dashboards/project/volumes/urls.py +++ b/openstack_dashboard/dashboards/project/volumes/urls.py @@ -12,58 +12,58 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.project.backups \ import views as backup_views from openstack_dashboard.dashboards.project.volumes import views urlpatterns = [ - url(r'^$', views.VolumesView.as_view(), name='index'), - url(r'^create/$', views.CreateView.as_view(), name='create'), - url(r'^(?P[^/]+)/extend/$', - views.ExtendView.as_view(), - name='extend'), - url(r'^(?P[^/]+)/attach/$', - views.EditAttachmentsView.as_view(), - name='attach'), - url(r'^(?P[^/]+)/create_snapshot/$', - views.CreateSnapshotView.as_view(), - name='create_snapshot'), - url(r'^(?P[^/]+)/create_transfer/$', - views.CreateTransferView.as_view(), - name='create_transfer'), - url(r'^accept_transfer/$', - views.AcceptTransferView.as_view(), - name='accept_transfer'), - url(r'^(?P[^/]+)/auth/(?P[^/]+)/$', - views.ShowTransferView.as_view(), - name='show_transfer'), - url(r'^(?P[^/]+)/create_backup/$', - backup_views.CreateBackupView.as_view(), - name='create_backup'), - url(r'^(?P[^/]+)/create_backup/(?P[^/]+)$', - backup_views.CreateBackupView.as_view(), - name='create_snapshot_backup'), - url(r'^(?P[^/]+)/$', - views.DetailView.as_view(), - name='detail'), - url(r'^(?P[^/]+)/\?tab=volume_details__snapshots_tab$', - views.DetailView.as_view(), - name='snapshots_tab'), - url(r'^(?P[^/]+)/upload_to_image/$', - views.UploadToImageView.as_view(), - name='upload_to_image'), - url(r'^(?P[^/]+)/update/$', - views.UpdateView.as_view(), - name='update'), - url(r'^(?P[^/]+)/retype/$', - views.RetypeView.as_view(), - name='retype'), - url(r'^(?P[^/]+)/encryption_detail/$', - views.EncryptionDetailView.as_view(), - name='encryption_detail'), - url(r'^(?P[^/]+)/download_creds/(?P[^/]+)$', - views.DownloadTransferCreds.as_view(), - name='download_transfer_creds'), + re_path(r'^$', views.VolumesView.as_view(), name='index'), + re_path(r'^create/$', views.CreateView.as_view(), name='create'), + re_path(r'^(?P[^/]+)/extend/$', + views.ExtendView.as_view(), + name='extend'), + re_path(r'^(?P[^/]+)/attach/$', + views.EditAttachmentsView.as_view(), + name='attach'), + re_path(r'^(?P[^/]+)/create_snapshot/$', + views.CreateSnapshotView.as_view(), + name='create_snapshot'), + re_path(r'^(?P[^/]+)/create_transfer/$', + views.CreateTransferView.as_view(), + name='create_transfer'), + re_path(r'^accept_transfer/$', + views.AcceptTransferView.as_view(), + name='accept_transfer'), + re_path(r'^(?P[^/]+)/auth/(?P[^/]+)/$', + views.ShowTransferView.as_view(), + name='show_transfer'), + re_path(r'^(?P[^/]+)/create_backup/$', + backup_views.CreateBackupView.as_view(), + name='create_backup'), + re_path(r'^(?P[^/]+)/create_backup/(?P[^/]+)$', + backup_views.CreateBackupView.as_view(), + name='create_snapshot_backup'), + re_path(r'^(?P[^/]+)/$', + views.DetailView.as_view(), + name='detail'), + re_path(r'^(?P[^/]+)/\?tab=volume_details__snapshots_tab$', + views.DetailView.as_view(), + name='snapshots_tab'), + re_path(r'^(?P[^/]+)/upload_to_image/$', + views.UploadToImageView.as_view(), + name='upload_to_image'), + re_path(r'^(?P[^/]+)/update/$', + views.UpdateView.as_view(), + name='update'), + re_path(r'^(?P[^/]+)/retype/$', + views.RetypeView.as_view(), + name='retype'), + re_path(r'^(?P[^/]+)/encryption_detail/$', + views.EncryptionDetailView.as_view(), + name='encryption_detail'), + re_path(r'^(?P[^/]+)/download_creds/(?P[^/]+)$', + views.DownloadTransferCreds.as_view(), + name='download_transfer_creds'), ] diff --git a/openstack_dashboard/dashboards/settings/password/urls.py b/openstack_dashboard/dashboards/settings/password/urls.py index 2b74d544a7..cc1a666008 100644 --- a/openstack_dashboard/dashboards/settings/password/urls.py +++ b/openstack_dashboard/dashboards/settings/password/urls.py @@ -12,11 +12,11 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.settings.password import views urlpatterns = [ - url(r'^$', views.PasswordView.as_view(), name='index'), + re_path(r'^$', views.PasswordView.as_view(), name='index'), ] diff --git a/openstack_dashboard/dashboards/settings/user/urls.py b/openstack_dashboard/dashboards/settings/user/urls.py index 1dd7753646..d5e133324c 100644 --- a/openstack_dashboard/dashboards/settings/user/urls.py +++ b/openstack_dashboard/dashboards/settings/user/urls.py @@ -12,11 +12,11 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.dashboards.settings.user import views urlpatterns = [ - url(r'^$', views.UserSettingsView.as_view(), name='index'), + re_path(r'^$', views.UserSettingsView.as_view(), name='index'), ] diff --git a/openstack_dashboard/test/error_pages_urls.py b/openstack_dashboard/test/error_pages_urls.py index 5f2b9f3c46..f871fcab40 100644 --- a/openstack_dashboard/test/error_pages_urls.py +++ b/openstack_dashboard/test/error_pages_urls.py @@ -10,9 +10,9 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from django.views import defaults from openstack_dashboard.urls import urlpatterns -urlpatterns.append(url(r'^500/$', defaults.server_error)) +urlpatterns.append(re_path(r'^500/$', defaults.server_error)) diff --git a/openstack_dashboard/test/extensible_header_urls.py b/openstack_dashboard/test/extensible_header_urls.py index fb481b00a0..a6ee90fc3a 100644 --- a/openstack_dashboard/test/extensible_header_urls.py +++ b/openstack_dashboard/test/extensible_header_urls.py @@ -10,9 +10,9 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.urls import urlpatterns # noqa from openstack_dashboard import views -urlpatterns.append(url(r'^header/', views.ExtensibleHeaderView.as_view())) +urlpatterns.append(re_path(r'^header/', views.ExtensibleHeaderView.as_view())) diff --git a/openstack_dashboard/test/test_panels/another_panel/urls.py b/openstack_dashboard/test/test_panels/another_panel/urls.py index f3f16d85c8..609178b2ab 100644 --- a/openstack_dashboard/test/test_panels/another_panel/urls.py +++ b/openstack_dashboard/test/test_panels/another_panel/urls.py @@ -10,10 +10,10 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.test.test_panels.another_panel import views urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), + re_path(r'^$', views.IndexView.as_view(), name='index'), ] diff --git a/openstack_dashboard/test/test_panels/nonloading_panel/urls.py b/openstack_dashboard/test/test_panels/nonloading_panel/urls.py index dbfbf51117..1fdd6dc9af 100644 --- a/openstack_dashboard/test/test_panels/nonloading_panel/urls.py +++ b/openstack_dashboard/test/test_panels/nonloading_panel/urls.py @@ -10,10 +10,10 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.test.test_panels.nonloading_panel import views urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), + re_path(r'^$', views.IndexView.as_view(), name='index'), ] diff --git a/openstack_dashboard/test/test_panels/plugin_panel/urls.py b/openstack_dashboard/test/test_panels/plugin_panel/urls.py index 848017c7db..67d1a2f261 100644 --- a/openstack_dashboard/test/test_panels/plugin_panel/urls.py +++ b/openstack_dashboard/test/test_panels/plugin_panel/urls.py @@ -10,10 +10,10 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.test.test_panels.plugin_panel import views urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), + re_path(r'^$', views.IndexView.as_view(), name='index'), ] diff --git a/openstack_dashboard/test/test_panels/second_panel/urls.py b/openstack_dashboard/test/test_panels/second_panel/urls.py index 709b66b32e..3335e35457 100644 --- a/openstack_dashboard/test/test_panels/second_panel/urls.py +++ b/openstack_dashboard/test/test_panels/second_panel/urls.py @@ -10,10 +10,10 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from openstack_dashboard.test.test_panels.second_panel import views urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), + re_path(r'^$', views.IndexView.as_view(), name='index'), ] diff --git a/openstack_dashboard/test/urls.py b/openstack_dashboard/test/urls.py index 48b262a3b7..2c6c065133 100644 --- a/openstack_dashboard/test/urls.py +++ b/openstack_dashboard/test/urls.py @@ -20,8 +20,8 @@ URL patterns for the OpenStack Dashboard. from django.conf import settings from django.conf.urls import include from django.conf.urls.static import static -from django.conf.urls import url from django.contrib.staticfiles.urls import staticfiles_urlpatterns +from django.urls import re_path from django.views import defaults import horizon.base @@ -34,14 +34,14 @@ from openstack_dashboard import views import horizon urlpatterns = [ - url(r'^$', views.splash, name='splash'), - url(r'^auth/', include('openstack_auth.urls')), - url(r'^api/', include(rest.urls)), - url(r'^jasmine/(.*?)$', jasmine.dispatcher), - url(r'', horizon.base._wrapped_include(horizon.urls)), - url(r'^ngdetails/', - browsers_views.AngularDetailsView.as_view(), - name='ngdetails'), + re_path(r'^$', views.splash, name='splash'), + re_path(r'^auth/', include('openstack_auth.urls')), + re_path(r'^api/', include(rest.urls)), + re_path(r'^jasmine/(.*?)$', jasmine.dispatcher), + re_path(r'', horizon.base._wrapped_include(horizon.urls)), + re_path(r'^ngdetails/', + browsers_views.AngularDetailsView.as_view(), + name='ngdetails'), ] # Development static app and project media serving using the staticfiles app. @@ -53,4 +53,4 @@ urlpatterns += staticfiles_urlpatterns() urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) if settings.DEBUG: - urlpatterns.append(url(r'^500/$', defaults.server_error)) + urlpatterns.append(re_path(r'^500/$', defaults.server_error)) diff --git a/openstack_dashboard/urls.py b/openstack_dashboard/urls.py index 09a309bce2..c376d16c6c 100644 --- a/openstack_dashboard/urls.py +++ b/openstack_dashboard/urls.py @@ -23,8 +23,8 @@ URL patterns for the OpenStack Dashboard. from django.conf import settings from django.conf.urls import include from django.conf.urls.static import static -from django.conf.urls import url from django.contrib.staticfiles.urls import staticfiles_urlpatterns +from django.urls import re_path from django.views import defaults import horizon @@ -36,21 +36,21 @@ from openstack_dashboard.api import rest from openstack_dashboard import views urlpatterns = [ - url(r'^$', views.splash, name='splash'), - url(r'^api/', include(rest.urls)), - url(r'^header/', views.ExtensibleHeaderView.as_view()), - url(r'', horizon.base._wrapped_include(horizon.urls)), + re_path(r'^$', views.splash, name='splash'), + re_path(r'^api/', include(rest.urls)), + re_path(r'^header/', views.ExtensibleHeaderView.as_view()), + re_path(r'', horizon.base._wrapped_include(horizon.urls)), ] # add URL for ngdetails -ngdetails_url = url(r'^ngdetails/', - browsers_views.AngularDetailsView.as_view(), - name='ngdetails') +ngdetails_url = re_path(r'^ngdetails/', + browsers_views.AngularDetailsView.as_view(), + name='ngdetails') urlpatterns.append(ngdetails_url) horizon.base._decorate_urlconf([ngdetails_url], require_auth) for u in settings.AUTHENTICATION_URLS: - urlpatterns.append(url(r'^auth/', include(u))) + urlpatterns.append(re_path(r'^auth/', include(u))) # Development static app and project media serving using the staticfiles app. urlpatterns += staticfiles_urlpatterns() @@ -61,4 +61,4 @@ urlpatterns += staticfiles_urlpatterns() urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) if settings.DEBUG: - urlpatterns.append(url(r'^500/$', defaults.server_error)) + urlpatterns.append(re_path(r'^500/$', defaults.server_error))