From 15e83c6448670f785ae816ca04b19c52c5dc0d7e Mon Sep 17 00:00:00 2001 From: Rob Cresswell Date: Mon, 15 Feb 2016 14:04:21 +0000 Subject: [PATCH] Update URLs to Django 1.8+ style Django 1.8 altered and deprecated the existing pattern for defining URLs. This will be removed in 1.10, meaning that many deprecation warnings show up under Django 1.9. We should fix the URLs promptly to avoid logspam, and to support Django 1.10 in Newton. See https://docs.djangoproject.com/en/1.9/releases/1.8/#django-conf-urls-patterns Change-Id: I074d20850de59bfe678a3bc72e9f0f25bd743cbf Partially-Implements: blueprint dj110 --- doc/source/topics/table_actions.rst | 5 ++-- doc/source/topics/workflows.rst | 6 ++--- horizon/base.py | 17 +++++-------- horizon/site_urls.py | 25 +++++++++---------- .../test/test_dashboards/cats/kittens/urls.py | 6 ++--- .../test/test_dashboards/cats/tigers/urls.py | 6 ++--- .../test/test_dashboards/dogs/puppies/urls.py | 6 ++--- horizon/test/urls.py | 6 ++--- openstack_dashboard/api/rest/urls.py | 1 - .../contrib/developer/theme_preview/urls.py | 6 ++--- .../dashboards/admin/aggregates/urls.py | 6 ++--- .../dashboards/admin/defaults/urls.py | 7 +++--- .../dashboards/admin/flavors/urls.py | 6 ++--- .../admin/hypervisors/compute/urls.py | 6 ++--- .../dashboards/admin/hypervisors/urls.py | 6 ++--- .../dashboards/admin/images/urls.py | 6 ++--- .../dashboards/admin/info/urls.py | 7 +++--- .../dashboards/admin/instances/urls.py | 14 +++++------ .../dashboards/admin/metadata_defs/urls.py | 6 ++--- .../dashboards/admin/metering/urls.py | 7 +++--- .../dashboards/admin/networks/ports/urls.py | 7 ++---- .../dashboards/admin/networks/subnets/urls.py | 9 +++---- .../dashboards/admin/networks/urls.py | 8 +++--- .../dashboards/admin/ngflavors/urls.py | 6 ++--- .../dashboards/admin/overview/urls.py | 6 ++--- .../dashboards/admin/routers/ports/urls.py | 7 +++--- .../dashboards/admin/routers/urls.py | 6 ++--- .../admin/volumes/snapshots/urls.py | 6 ++--- .../dashboards/admin/volumes/urls.py | 6 ++--- .../admin/volumes/volume_types/extras/urls.py | 8 +++--- .../volumes/volume_types/qos_specs/urls.py | 8 +++--- .../admin/volumes/volume_types/urls.py | 7 ++---- .../dashboards/admin/volumes/volumes/urls.py | 8 ++---- .../dashboards/identity/domains/urls.py | 6 ++--- .../dashboards/identity/groups/urls.py | 6 ++--- .../identity_providers/protocols/urls.py | 7 ++---- .../identity/identity_providers/urls.py | 7 ++---- .../dashboards/identity/mappings/urls.py | 7 +++--- .../dashboards/identity/ngusers/urls.py | 6 ++--- .../dashboards/identity/projects/urls.py | 6 ++--- .../dashboards/identity/roles/urls.py | 7 +++--- .../dashboards/identity/users/urls.py | 10 +++----- .../access_and_security/api_access/urls.py | 6 ++--- .../access_and_security/floating_ips/urls.py | 8 +++--- .../access_and_security/keypairs/urls.py | 6 ++--- .../security_groups/urls.py | 6 ++--- .../project/access_and_security/urls.py | 6 ++--- .../dashboards/project/containers/urls.py | 11 +++----- .../dashboards/project/firewalls/urls.py | 7 +++--- .../dashboards/project/images/images/urls.py | 9 ++----- .../project/images/snapshots/urls.py | 6 ++--- .../dashboards/project/images/urls.py | 6 ++--- .../dashboards/project/instances/urls.py | 16 +++++------- .../dashboards/project/loadbalancers/urls.py | 7 +++--- .../project/network_topology/urls.py | 7 ++---- .../dashboards/project/networks/ports/urls.py | 10 +++----- .../project/networks/subnets/urls.py | 10 +++----- .../dashboards/project/networks/urls.py | 7 +++--- .../dashboards/project/ngimages/urls.py | 6 ++--- .../dashboards/project/overview/urls.py | 7 ++---- .../dashboards/project/routers/ports/urls.py | 7 +++--- .../dashboards/project/routers/urls.py | 6 ++--- .../project/stacks/resource_types/urls.py | 6 ++--- .../dashboards/project/stacks/urls.py | 6 ++--- .../project/volumes/backups/urls.py | 10 ++------ .../project/volumes/cgroups/urls.py | 6 ++--- .../project/volumes/snapshots/urls.py | 6 ++--- .../dashboards/project/volumes/urls.py | 6 ++--- .../project/volumes/volumes/urls.py | 8 ++---- .../dashboards/project/vpn/urls.py | 7 +++--- .../dashboards/settings/password/urls.py | 7 +++--- .../dashboards/settings/user/urls.py | 7 +++--- openstack_dashboard/test/error_pages_urls.py | 8 +++--- .../test/test_panels/another_panel/urls.py | 6 ++--- .../test/test_panels/nonloading_panel/urls.py | 6 ++--- .../test/test_panels/plugin_panel/urls.py | 6 ++--- .../test/test_panels/second_panel/urls.py | 6 ++--- openstack_dashboard/test/urls.py | 18 ++++++------- openstack_dashboard/urls.py | 24 ++++++++---------- 79 files changed, 216 insertions(+), 390 deletions(-) diff --git a/doc/source/topics/table_actions.rst b/doc/source/topics/table_actions.rst index 160e12c3f1..fab72b1b43 100644 --- a/doc/source/topics/table_actions.rst +++ b/doc/source/topics/table_actions.rst @@ -172,19 +172,18 @@ 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 patterns from django.conf.urls import url from openstack_dashboard.dashboards.mydashboard.mypanel import views - urlpatterns = patterns('', + urlpatterns = [, url(r'^$', views.IndexView.as_view(), name='index'), url(r'^(?P[^/]+)/create_snapshot/$', views.CreateSnapshotView.as_view(), name='create_snapshot'), - ) + ] diff --git a/doc/source/topics/workflows.rst b/doc/source/topics/workflows.rst index 467a6daeea..6b28deacfd 100644 --- a/doc/source/topics/workflows.rst +++ b/doc/source/topics/workflows.rst @@ -28,9 +28,9 @@ urls, views, workflows and templates: RESOURCE_CLASS = r'^(?P[^/]+)/%s$' - urlpatterns = patterns( - '', - url(RESOURCE_CLASS % 'update', UpdateView.as_view(), name='update')) + urlpatterns = [ + url(RESOURCE_CLASS % 'update', UpdateView.as_view(), name='update') + ] #. In ``views.py``, we pass data to the template and to the action(form) (action can also pass data to the ``get_context_data`` method and to the diff --git a/horizon/base.py b/horizon/base.py index 3295c23917..e77b1879c4 100644 --- a/horizon/base.py +++ b/horizon/base.py @@ -28,7 +28,6 @@ import os from django.conf import settings from django.conf.urls import include -from django.conf.urls import patterns from django.conf.urls import url from django.core.exceptions import ImproperlyConfigured # noqa from django.core.urlresolvers import reverse @@ -113,7 +112,7 @@ class HorizonComponent(object): urls_mod = import_module('.urls', package_string) urlpatterns = urls_mod.urlpatterns else: - urlpatterns = patterns('') + urlpatterns = [] return urlpatterns # FIXME(lhcheng): Removed the access_cached decorator for now until @@ -529,16 +528,13 @@ class Dashboard(Registry, HorizonComponent): default_panel = panel continue url_slug = panel.slug.replace('.', '/') - urlpatterns += patterns('', - url(r'^%s/' % url_slug, - include(panel._decorated_urls))) + urlpatterns.append(url(r'^%s/' % url_slug, + 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 += patterns('', - url(r'', - include(default_panel._decorated_urls))) + urlpatterns.append(url(r'', include(default_panel._decorated_urls))) # Require login if not public. if not self.public: @@ -855,9 +851,8 @@ class Site(Registry, HorizonComponent): # Compile the dynamic urlconf. for dash in self._registry.values(): - urlpatterns += patterns('', - url(r'^%s/' % dash.slug, - include(dash._decorated_urls))) + urlpatterns.append(url(r'^%s/' % dash.slug, + include(dash._decorated_urls))) # Return the three arguments to django.conf.urls.include return urlpatterns, self.namespace, self.slug diff --git a/horizon/site_urls.py b/horizon/site_urls.py index 3fa3f6062f..a6b509c7d4 100644 --- a/horizon/site_urls.py +++ b/horizon/site_urls.py @@ -18,34 +18,33 @@ from django.conf import settings from django.conf.urls import include -from django.conf.urls import patterns from django.conf.urls import url from django.views.generic import TemplateView # noqa +from django.views import i18n from horizon.test.jasmine import jasmine +from horizon import views -urlpatterns = patterns( - 'horizon.views', - url(r'^home/$', 'user_home', name='user_home') -) +urlpatterns = [ + url(r'^home/$', views.user_home, name='user_home') +] # Client-side i18n URLconf. -urlpatterns += patterns( - '', +urlpatterns.extend([ url(r'^i18n/js/(?P\S+?)/$', - 'django.views.i18n.javascript_catalog', + i18n.javascript_catalog, name='jsi18n'), url(r'^i18n/setlang/$', - 'django.views.i18n.set_language', + i18n.set_language, name="set_language"), url(r'^i18n/', include('django.conf.urls.i18n')) -) +]) if settings.DEBUG: - urlpatterns += patterns( - '', + urlpatterns.extend([ url(r'^jasmine-legacy/$', TemplateView.as_view( template_name="horizon/jasmine/jasmine_legacy.html"), name='jasmine_tests'), - url(r'^jasmine/.*?$', jasmine.dispatcher)) + url(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 400541dc3a..1d3c7be70d 100644 --- a/horizon/test/test_dashboards/cats/kittens/urls.py +++ b/horizon/test/test_dashboards/cats/kittens/urls.py @@ -10,12 +10,10 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from horizon.test.test_dashboards.cats.kittens.views import IndexView # noqa -urlpatterns = patterns( - '', +urlpatterns = [ url(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 7316d1d703..49f943a19a 100644 --- a/horizon/test/test_dashboards/cats/tigers/urls.py +++ b/horizon/test/test_dashboards/cats/tigers/urls.py @@ -10,12 +10,10 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from horizon.test.test_dashboards.cats.tigers.views import IndexView # noqa -urlpatterns = patterns( - '', +urlpatterns = [ url(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 0d32da9960..2b728c57a5 100644 --- a/horizon/test/test_dashboards/dogs/puppies/urls.py +++ b/horizon/test/test_dashboards/dogs/puppies/urls.py @@ -10,14 +10,12 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from horizon.test.test_dashboards.dogs.puppies.views import IndexView # noqa from horizon.test.test_dashboards.dogs.puppies.views import TwoTabsView # noqa -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^$', IndexView.as_view(), name='index'), url(r'^tabs/$', TwoTabsView.as_view(), name='tabs'), -) +] diff --git a/horizon/test/urls.py b/horizon/test/urls.py index 74c14c6325..82939fbd97 100644 --- a/horizon/test/urls.py +++ b/horizon/test/urls.py @@ -21,7 +21,6 @@ URL patterns for testing Horizon views. """ from django.conf.urls import include -from django.conf.urls import patterns from django.conf.urls import url from django.contrib.staticfiles.urls import staticfiles_urlpatterns # noqa from django.views.generic import TemplateView # noqa @@ -30,8 +29,7 @@ import horizon from horizon.test.jasmine import jasmine -urlpatterns = patterns( - '', +urlpatterns = [ url(r'', include(horizon.urls)), url(r"auth/login/", "django.contrib.auth.views.login", {'template_name': "auth/login.html"}, @@ -42,6 +40,6 @@ urlpatterns = patterns( TemplateView.as_view( template_name="horizon/jasmine/jasmine_legacy.html"), name='jasmine_tests'), -) +] urlpatterns += staticfiles_urlpatterns() diff --git a/openstack_dashboard/api/rest/urls.py b/openstack_dashboard/api/rest/urls.py index 06d22a907c..e4556ea9a1 100644 --- a/openstack_dashboard/api/rest/urls.py +++ b/openstack_dashboard/api/rest/urls.py @@ -28,6 +28,5 @@ def register(view): Django URL regex pattern. ''' p = urls.url(view.url_regex, view.as_view()) - p.add_prefix('openstack_dashboard.rest_api') urlpatterns.append(p) return view diff --git a/openstack_dashboard/contrib/developer/theme_preview/urls.py b/openstack_dashboard/contrib/developer/theme_preview/urls.py index dd89ec595a..9fea8f73d5 100644 --- a/openstack_dashboard/contrib/developer/theme_preview/urls.py +++ b/openstack_dashboard/contrib/developer/theme_preview/urls.py @@ -12,13 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.contrib.developer.theme_preview import views -urlpatterns = patterns( - 'openstack_dashboard.contrib.developer.theme_preview.views', +urlpatterns = [ url(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 50ac748bda..fc15d0bf61 100644 --- a/openstack_dashboard/dashboards/admin/aggregates/urls.py +++ b/openstack_dashboard/dashboards/admin/aggregates/urls.py @@ -10,15 +10,13 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.admin.aggregates \ import views -urlpatterns = patterns( - 'openstack_dashboard.dashboards.admin.aggregates.views', +urlpatterns = [ url(r'^$', views.IndexView.as_view(), name='index'), url(r'^create/$', @@ -27,4 +25,4 @@ urlpatterns = patterns( views.UpdateView.as_view(), name='update'), url(r'^(?P[^/]+)/manage_hosts/$', views.ManageHostsView.as_view(), name='manage_hosts'), -) +] diff --git a/openstack_dashboard/dashboards/admin/defaults/urls.py b/openstack_dashboard/dashboards/admin/defaults/urls.py index 46a837dfff..89a4b834f0 100644 --- a/openstack_dashboard/dashboards/admin/defaults/urls.py +++ b/openstack_dashboard/dashboards/admin/defaults/urls.py @@ -12,14 +12,13 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.admin.defaults import views -urlpatterns = patterns( - 'openstack_dashboard.dashboards.admin.defaults.views', +urlpatterns = [ url(r'^$', views.IndexView.as_view(), name='index'), url(r'^update_defaults$', - views.UpdateDefaultQuotasView.as_view(), name='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 1e3e52563c..4f044b483c 100644 --- a/openstack_dashboard/dashboards/admin/flavors/urls.py +++ b/openstack_dashboard/dashboards/admin/flavors/urls.py @@ -16,15 +16,13 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.admin.flavors import views -urlpatterns = patterns( - 'openstack_dashboard.dashboards.admin.flavors.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'), -) +] diff --git a/openstack_dashboard/dashboards/admin/hypervisors/compute/urls.py b/openstack_dashboard/dashboards/admin/hypervisors/compute/urls.py index aa67e23aec..624e49f6a7 100644 --- a/openstack_dashboard/dashboards/admin/hypervisors/compute/urls.py +++ b/openstack_dashboard/dashboards/admin/hypervisors/compute/urls.py @@ -10,14 +10,12 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.admin.hypervisors.compute import views -urlpatterns = patterns( - 'openstack_dashboard.dashboards.admin.hypervisors.compute.views', +urlpatterns = [ url(r'^(?P[^/]+)/evacuate_host$', views.EvacuateHostView.as_view(), name='evacuate_host'), @@ -27,4 +25,4 @@ urlpatterns = patterns( url(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 7db7b73692..136a3cfdc9 100644 --- a/openstack_dashboard/dashboards/admin/hypervisors/urls.py +++ b/openstack_dashboard/dashboards/admin/hypervisors/urls.py @@ -13,7 +13,6 @@ # under the License. from django.conf.urls import include -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.admin.hypervisors.compute \ @@ -21,11 +20,10 @@ from openstack_dashboard.dashboards.admin.hypervisors.compute \ from openstack_dashboard.dashboards.admin.hypervisors import views -urlpatterns = patterns( - 'openstack_dashboard.dashboards.admin.hypervisors.views', +urlpatterns = [ url(r'^(?P[^/]+)/$', views.AdminDetailView.as_view(), name='detail'), url(r'^$', views.AdminIndexView.as_view(), name='index'), url(r'', include(compute_urls, namespace='compute')), -) +] diff --git a/openstack_dashboard/dashboards/admin/images/urls.py b/openstack_dashboard/dashboards/admin/images/urls.py index b8db5fa772..2a907c9e7a 100644 --- a/openstack_dashboard/dashboards/admin/images/urls.py +++ b/openstack_dashboard/dashboards/admin/images/urls.py @@ -16,18 +16,16 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.admin.images import views -urlpatterns = patterns( - 'openstack_dashboard.dashboards.admin.images.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[^/]+)/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 36d395442e..2a9c096cec 100644 --- a/openstack_dashboard/dashboards/admin/info/urls.py +++ b/openstack_dashboard/dashboards/admin/info/urls.py @@ -16,12 +16,11 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.admin.info import views -urlpatterns = patterns( - 'openstack_dashboard.dashboards.admin.info.views', - url(r'^$', views.IndexView.as_view(), name='index')) +urlpatterns = [ + url(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 8993ecd180..455942cee8 100644 --- a/openstack_dashboard/dashboards/admin/instances/urls.py +++ b/openstack_dashboard/dashboards/admin/instances/urls.py @@ -16,7 +16,6 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.admin.instances import views @@ -25,15 +24,14 @@ from openstack_dashboard.dashboards.admin.instances import views INSTANCES = r'^(?P[^/]+)/%s$' -urlpatterns = patterns( - 'openstack_dashboard.dashboards.admin.instances.views', +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', 'console', name='console'), - url(INSTANCES % 'vnc', 'vnc', name='vnc'), - url(INSTANCES % 'spice', 'spice', name='spice'), - url(INSTANCES % 'rdp', 'rdp', name='rdp'), + url(INSTANCES % 'console', views.console, name='console'), + url(INSTANCES % 'vnc', views.vnc, name='vnc'), + 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'), -) +] diff --git a/openstack_dashboard/dashboards/admin/metadata_defs/urls.py b/openstack_dashboard/dashboards/admin/metadata_defs/urls.py index 51d30ecd60..ef6c32fc3f 100644 --- a/openstack_dashboard/dashboards/admin/metadata_defs/urls.py +++ b/openstack_dashboard/dashboards/admin/metadata_defs/urls.py @@ -12,7 +12,6 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns # noqa from django.conf.urls import url # noqa from openstack_dashboard.dashboards.admin.metadata_defs import views @@ -21,11 +20,10 @@ from openstack_dashboard.dashboards.admin.metadata_defs import views NAMESPACES = r'^(?P[^/]+)/%s$' -urlpatterns = patterns( - 'openstack_dashboard.dashboards.admin.metadata_defs.views', +urlpatterns = [ url(r'^$', views.AdminIndexView.as_view(), name='index'), url(r'^create/$', views.CreateView.as_view(), name='create'), url(NAMESPACES % 'detail', views.DetailView.as_view(), name='detail'), url(r'^(?P[^/]+)/resource_types/$', views.ManageResourceTypes.as_view(), name='resource_types'), -) +] diff --git a/openstack_dashboard/dashboards/admin/metering/urls.py b/openstack_dashboard/dashboards/admin/metering/urls.py index 33279ebd19..e1df2ce9cf 100644 --- a/openstack_dashboard/dashboards/admin/metering/urls.py +++ b/openstack_dashboard/dashboards/admin/metering/urls.py @@ -10,14 +10,13 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.admin.metering import views -urlpatterns = patterns( - 'openstack_dashboard.dashboards.admin.metering.views', +urlpatterns = [ url(r'^$', views.IndexView.as_view(), name='index'), url(r'^create/$', views.CreateUsageReport.as_view(), name='create'), url(r'^samples$', views.SamplesView.as_view(), name='samples'), - url(r'^report/csv$', views.CsvReportView.as_view(), name='csvreport')) + url(r'^report/csv$', views.CsvReportView.as_view(), name='csvreport'), +] diff --git a/openstack_dashboard/dashboards/admin/networks/ports/urls.py b/openstack_dashboard/dashboards/admin/networks/ports/urls.py index 02e92eb735..93952b8599 100644 --- a/openstack_dashboard/dashboards/admin/networks/ports/urls.py +++ b/openstack_dashboard/dashboards/admin/networks/ports/urls.py @@ -12,16 +12,13 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.admin.networks.ports import views PORTS = r'^(?P[^/]+)/%s$' -VIEW_MOD = 'openstack_dashboard.dashboards.admin.networks.ports.views' -urlpatterns = patterns( - VIEW_MOD, +urlpatterns = [ url(PORTS % 'detail', views.DetailView.as_view(), name='detail') -) +] diff --git a/openstack_dashboard/dashboards/admin/networks/subnets/urls.py b/openstack_dashboard/dashboards/admin/networks/subnets/urls.py index fbb3e4616f..8b4a507f36 100644 --- a/openstack_dashboard/dashboards/admin/networks/subnets/urls.py +++ b/openstack_dashboard/dashboards/admin/networks/subnets/urls.py @@ -12,17 +12,14 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.admin.networks.subnets import views SUBNETS = r'^(?P[^/]+)/%s$' -VIEW_MOD = 'openstack_dashboard.dashboards.admin.networks.subnets.views' -urlpatterns = patterns( - VIEW_MOD, - url(SUBNETS % 'detail', views.DetailView.as_view(), name='detail') -) +urlpatterns = [ + url(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 d304cd7a0e..4cd1b60079 100644 --- a/openstack_dashboard/dashboards/admin/networks/urls.py +++ b/openstack_dashboard/dashboards/admin/networks/urls.py @@ -13,7 +13,6 @@ # under the License. from django.conf.urls import include -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.admin.networks.agents \ @@ -32,12 +31,10 @@ from openstack_dashboard.dashboards.admin.networks import views NETWORKS = r'^(?P[^/]+)/%s$' -urlpatterns = patterns( - '', +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'), - # for detail view url(NETWORKS % 'detail', views.DetailView.as_view(), name='detail'), url(NETWORKS % 'agents/add', agent_views.AddView.as_view(), name='adddhcpagent'), @@ -51,4 +48,5 @@ urlpatterns = patterns( port_views.UpdateView.as_view(), name='editport'), url(r'^subnets/', include(subnet_urls, namespace='subnets')), - url(r'^ports/', include(port_urls, namespace='ports'))) + url(r'^ports/', include(port_urls, namespace='ports')), +] diff --git a/openstack_dashboard/dashboards/admin/ngflavors/urls.py b/openstack_dashboard/dashboards/admin/ngflavors/urls.py index c5b5daf8a3..79bcb97a59 100644 --- a/openstack_dashboard/dashboards/admin/ngflavors/urls.py +++ b/openstack_dashboard/dashboards/admin/ngflavors/urls.py @@ -13,13 +13,11 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.admin.ngflavors import views -urlpatterns = patterns( - 'openstack_dashboard.dashboards.admin.ngflavors.views', +urlpatterns = [ url(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 9ca0984677..652ec643ff 100644 --- a/openstack_dashboard/dashboards/admin/overview/urls.py +++ b/openstack_dashboard/dashboards/admin/overview/urls.py @@ -17,13 +17,11 @@ # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.admin.overview import views -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^$', views.GlobalOverview.as_view(), name='index'), -) +] diff --git a/openstack_dashboard/dashboards/admin/routers/ports/urls.py b/openstack_dashboard/dashboards/admin/routers/ports/urls.py index 4d259cbbb9..fe785c49e6 100644 --- a/openstack_dashboard/dashboards/admin/routers/ports/urls.py +++ b/openstack_dashboard/dashboards/admin/routers/ports/urls.py @@ -12,13 +12,12 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.admin.routers.ports import views PORTS = r'^(?P[^/]+)/%s$' -urlpatterns = patterns( - 'horizon.dashboards.admin.networks.ports.views', - url(PORTS % 'detail', views.DetailView.as_view(), name='detail')) +urlpatterns = [ + url(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 5d4d68d7b4..226a810c78 100644 --- a/openstack_dashboard/dashboards/admin/routers/urls.py +++ b/openstack_dashboard/dashboards/admin/routers/urls.py @@ -12,7 +12,6 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.admin.routers import views @@ -21,8 +20,7 @@ from openstack_dashboard.dashboards.admin.routers import views ROUTER_URL = r'^(?P[^/]+)/%s' -urlpatterns = patterns( - 'horizon.dashboards.admin.routers.views', +urlpatterns = [ url(r'^$', views.IndexView.as_view(), name='index'), url(ROUTER_URL % '$', views.DetailView.as_view(), @@ -30,4 +28,4 @@ urlpatterns = patterns( url(ROUTER_URL % 'update', views.UpdateView.as_view(), name='update'), -) +] diff --git a/openstack_dashboard/dashboards/admin/volumes/snapshots/urls.py b/openstack_dashboard/dashboards/admin/volumes/snapshots/urls.py index a83075b463..ea906568dd 100644 --- a/openstack_dashboard/dashboards/admin/volumes/snapshots/urls.py +++ b/openstack_dashboard/dashboards/admin/volumes/snapshots/urls.py @@ -10,18 +10,16 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.admin.volumes.snapshots import views -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^(?P[^/]+)$', views.DetailView.as_view(), name='detail'), url(r'^(?P[^/]+)/update_status/$', views.UpdateStatusView.as_view(), name='update_status'), -) +] diff --git a/openstack_dashboard/dashboards/admin/volumes/urls.py b/openstack_dashboard/dashboards/admin/volumes/urls.py index 56ebaa9b6e..fdf126674a 100644 --- a/openstack_dashboard/dashboards/admin/volumes/urls.py +++ b/openstack_dashboard/dashboards/admin/volumes/urls.py @@ -11,7 +11,6 @@ # under the License. from django.conf.urls import include -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.admin.volumes.snapshots \ @@ -22,8 +21,7 @@ from openstack_dashboard.dashboards.admin.volumes.volume_types \ from openstack_dashboard.dashboards.admin.volumes.volumes \ import urls as volumes_urls -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^$', views.IndexView.as_view(), name='index'), @@ -42,4 +40,4 @@ urlpatterns = patterns( include(volume_types_urls, namespace='volume_types')), url(r'snapshots/', include(snapshot_urls, namespace='snapshots')), -) +] diff --git a/openstack_dashboard/dashboards/admin/volumes/volume_types/extras/urls.py b/openstack_dashboard/dashboards/admin/volumes/volume_types/extras/urls.py index 5b36b94223..cbae675c5f 100644 --- a/openstack_dashboard/dashboards/admin/volumes/volume_types/extras/urls.py +++ b/openstack_dashboard/dashboards/admin/volumes/volume_types/extras/urls.py @@ -10,15 +10,13 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.admin.volumes.volume_types.extras \ import views -urlpatterns = patterns( - '', +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') -) + url(r'^(?P[^/]+)/edit/$', views.EditView.as_view(), name='edit'), +] diff --git a/openstack_dashboard/dashboards/admin/volumes/volume_types/qos_specs/urls.py b/openstack_dashboard/dashboards/admin/volumes/volume_types/qos_specs/urls.py index e054678e4f..30fe4fc9f7 100644 --- a/openstack_dashboard/dashboards/admin/volumes/volume_types/qos_specs/urls.py +++ b/openstack_dashboard/dashboards/admin/volumes/volume_types/qos_specs/urls.py @@ -10,17 +10,15 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.admin.volumes.volume_types.qos_specs \ import views -urlpatterns = patterns( - '', +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') -) + views.EditKeyValuePairView.as_view(), name='edit'), +] diff --git a/openstack_dashboard/dashboards/admin/volumes/volume_types/urls.py b/openstack_dashboard/dashboards/admin/volumes/volume_types/urls.py index 3b3b8aac86..cbcd7f2e6c 100644 --- a/openstack_dashboard/dashboards/admin/volumes/volume_types/urls.py +++ b/openstack_dashboard/dashboards/admin/volumes/volume_types/urls.py @@ -11,7 +11,6 @@ # under the License. from django.conf.urls import include -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.admin.volumes.volume_types.extras \ @@ -21,10 +20,8 @@ from openstack_dashboard.dashboards.admin.volumes.volume_types.qos_specs \ from openstack_dashboard.dashboards.admin.volumes.volume_types \ import views -VIEWS_MOD = ('openstack_dashboard.dashboards.admin.volumes.volume_types.views') -urlpatterns = patterns( - 'VIEWS_MOD', +urlpatterns = [ url(r'^create_type$', views.CreateVolumeTypeView.as_view(), name='create_type'), url(r'^(?P[^/]+)/update_type/$', @@ -51,4 +48,4 @@ urlpatterns = patterns( name='type_encryption_detail'), url(r'^qos_specs/', include(qos_specs_urls, namespace='qos_specs')), -) +] diff --git a/openstack_dashboard/dashboards/admin/volumes/volumes/urls.py b/openstack_dashboard/dashboards/admin/volumes/volumes/urls.py index 0b6e8e8293..279c4f3902 100644 --- a/openstack_dashboard/dashboards/admin/volumes/volumes/urls.py +++ b/openstack_dashboard/dashboards/admin/volumes/volumes/urls.py @@ -10,16 +10,12 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.admin.volumes.volumes \ import views -VIEWS_MOD = ('openstack_dashboard.dashboards.admin.volumes.volumes.views') - -urlpatterns = patterns( - VIEWS_MOD, +urlpatterns = [ url(r'^manage/$', views.ManageVolumeView.as_view(), name='manage'), @@ -35,4 +31,4 @@ urlpatterns = patterns( url(r'^(?P[^/]+)/migrate$', views.MigrateVolumeView.as_view(), name='migrate'), -) +] diff --git a/openstack_dashboard/dashboards/identity/domains/urls.py b/openstack_dashboard/dashboards/identity/domains/urls.py index 65e2d0c89f..dbf521b48b 100644 --- a/openstack_dashboard/dashboards/identity/domains/urls.py +++ b/openstack_dashboard/dashboards/identity/domains/urls.py @@ -12,16 +12,14 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.identity.domains import views -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^$', views.IndexView.as_view(), name='index'), url(r'^create$', views.CreateDomainView.as_view(), name='create'), url(r'^(?P[^/]+)/update/$', views.UpdateDomainView.as_view(), name='update') -) +] diff --git a/openstack_dashboard/dashboards/identity/groups/urls.py b/openstack_dashboard/dashboards/identity/groups/urls.py index 7a3d1a9407..74d4d11ee4 100644 --- a/openstack_dashboard/dashboards/identity/groups/urls.py +++ b/openstack_dashboard/dashboards/identity/groups/urls.py @@ -12,14 +12,12 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.identity.groups import views -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^$', views.IndexView.as_view(), name='index'), url(r'^create$', views.CreateView.as_view(), name='create'), url(r'^(?P[^/]+)/update/$', @@ -28,4 +26,4 @@ urlpatterns = patterns( views.ManageMembersView.as_view(), name='manage_members'), url(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 db5d4c2dc0..8c1e5494f4 100644 --- a/openstack_dashboard/dashboards/identity/identity_providers/protocols/urls.py +++ b/openstack_dashboard/dashboards/identity/identity_providers/protocols/urls.py @@ -12,8 +12,6 @@ # License for the specific language governing permissions and limitations # under the License. - -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.identity.identity_providers.protocols \ @@ -21,7 +19,6 @@ from openstack_dashboard.dashboards.identity.identity_providers.protocols \ PORTS = r'^(?P[^/]+)/%s$' -urlpatterns = patterns( - 'horizon.dashboards.identity.identity_providers.protocols.views', +urlpatterns = [ url(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 9170b687d7..8ea262be40 100644 --- a/openstack_dashboard/dashboards/identity/identity_providers/urls.py +++ b/openstack_dashboard/dashboards/identity/identity_providers/urls.py @@ -13,7 +13,6 @@ # under the License. from django.conf.urls import include -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.identity.identity_providers.protocols \ @@ -21,9 +20,7 @@ from openstack_dashboard.dashboards.identity.identity_providers.protocols \ from openstack_dashboard.dashboards.identity.identity_providers \ import views - -urlpatterns = patterns( - 'openstack_dashboard.dashboards.identity.identity_providers.views', +urlpatterns = [ url(r'^$', views.IndexView.as_view(), name='index'), url(r'^(?P[^/]+)/detail/$', views.DetailView.as_view(), name='detail'), @@ -36,4 +33,4 @@ urlpatterns = patterns( url(r'^register/$', views.RegisterView.as_view(), name='register'), url(r'(?P[^/]+)/protocols/', include(protocol_urls, namespace='protocols')), -) +] diff --git a/openstack_dashboard/dashboards/identity/mappings/urls.py b/openstack_dashboard/dashboards/identity/mappings/urls.py index 1847f154f1..77a243e9e4 100644 --- a/openstack_dashboard/dashboards/identity/mappings/urls.py +++ b/openstack_dashboard/dashboards/identity/mappings/urls.py @@ -12,14 +12,13 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.identity.mappings import views -urlpatterns = patterns( - 'openstack_dashboard.dashboards.identity.mappings.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')) + url(r'^create/$', views.CreateView.as_view(), name='create'), +] diff --git a/openstack_dashboard/dashboards/identity/ngusers/urls.py b/openstack_dashboard/dashboards/identity/ngusers/urls.py index 3c471dc1cf..df75ff887a 100644 --- a/openstack_dashboard/dashboards/identity/ngusers/urls.py +++ b/openstack_dashboard/dashboards/identity/ngusers/urls.py @@ -12,13 +12,11 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.identity.ngusers import views -urlpatterns = patterns( - 'openstack_dashboard.dashboards.identity.ngusers.views', +urlpatterns = [ url(r'^$', views.IndexView.as_view(), name='index'), -) +] diff --git a/openstack_dashboard/dashboards/identity/projects/urls.py b/openstack_dashboard/dashboards/identity/projects/urls.py index 6528a267cb..e0b1eb4d4a 100644 --- a/openstack_dashboard/dashboards/identity/projects/urls.py +++ b/openstack_dashboard/dashboards/identity/projects/urls.py @@ -16,14 +16,12 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.identity.projects import views -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^$', views.IndexView.as_view(), name='index'), url(r'^create$', views.CreateProjectView.as_view(), name='create'), url(r'^(?P[^/]+)/update/$', @@ -32,4 +30,4 @@ urlpatterns = patterns( views.ProjectUsageView.as_view(), name='usage'), url(r'^(?P[^/]+)/detail/$', views.DetailProjectView.as_view(), name='detail'), -) +] diff --git a/openstack_dashboard/dashboards/identity/roles/urls.py b/openstack_dashboard/dashboards/identity/roles/urls.py index a60b26eb97..e0b50ba3a6 100644 --- a/openstack_dashboard/dashboards/identity/roles/urls.py +++ b/openstack_dashboard/dashboards/identity/roles/urls.py @@ -12,14 +12,13 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.identity.roles import views -urlpatterns = patterns( - 'openstack_dashboard.dashboards.identity.roles.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')) + url(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 5690f42c89..5ddd9b8d04 100644 --- a/openstack_dashboard/dashboards/identity/users/urls.py +++ b/openstack_dashboard/dashboards/identity/users/urls.py @@ -16,17 +16,12 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.identity.users import views -VIEWS_MOD = 'openstack_dashboard.dashboards.identity.users.views' - - -urlpatterns = patterns( - VIEWS_MOD, +urlpatterns = [ url(r'^$', views.IndexView.as_view(), name='index'), url(r'^(?P[^/]+)/update/$', views.UpdateView.as_view(), name='update'), @@ -34,4 +29,5 @@ urlpatterns = patterns( url(r'^(?P[^/]+)/detail/$', views.DetailView.as_view(), name='detail'), url(r'^(?P[^/]+)/change_password/$', - views.ChangePasswordView.as_view(), name='change_password')) + views.ChangePasswordView.as_view(), name='change_password'), +] diff --git a/openstack_dashboard/dashboards/project/access_and_security/api_access/urls.py b/openstack_dashboard/dashboards/project/access_and_security/api_access/urls.py index 0405bfae5f..058aae2f44 100644 --- a/openstack_dashboard/dashboards/project/access_and_security/api_access/urls.py +++ b/openstack_dashboard/dashboards/project/access_and_security/api_access/urls.py @@ -16,15 +16,13 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.project.access_and_security.\ api_access import views -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^ec2/$', views.download_ec2_bundle, name='ec2'), url(r'^openrc/$', views.download_rc_file, name='openrc'), url(r'^openrcv2/$', views.download_rc_file_v2, name='openrcv2'), @@ -32,4 +30,4 @@ urlpatterns = patterns( name='view_credentials'), url(r'^recreate_ec2_credentials/$', views.RecreateCredentialsView.as_view(), name='recreate_credentials'), -) +] diff --git a/openstack_dashboard/dashboards/project/access_and_security/floating_ips/urls.py b/openstack_dashboard/dashboards/project/access_and_security/floating_ips/urls.py index c2903488b0..af3cef809a 100644 --- a/openstack_dashboard/dashboards/project/access_and_security/floating_ips/urls.py +++ b/openstack_dashboard/dashboards/project/access_and_security/floating_ips/urls.py @@ -16,15 +16,13 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.project.access_and_security.\ floating_ips import views -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^associate/$', views.AssociateView.as_view(), name='associate'), - url(r'^allocate/$', views.AllocateView.as_view(), name='allocate') -) + url(r'^allocate/$', views.AllocateView.as_view(), name='allocate'), +] diff --git a/openstack_dashboard/dashboards/project/access_and_security/keypairs/urls.py b/openstack_dashboard/dashboards/project/access_and_security/keypairs/urls.py index 29c7e5702f..fb1a418bfa 100644 --- a/openstack_dashboard/dashboards/project/access_and_security/keypairs/urls.py +++ b/openstack_dashboard/dashboards/project/access_and_security/keypairs/urls.py @@ -16,15 +16,13 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.project.access_and_security.keypairs \ import views -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^create/$', views.CreateView.as_view(), name='create'), url(r'^import/$', views.ImportView.as_view(), name='import'), url(r'^(?P[^/]+)/download/$', views.DownloadView.as_view(), @@ -35,4 +33,4 @@ urlpatterns = patterns( views.GenerateView.as_view(), name='generate'), url(r'^(?P[^/]+)/$', views.DetailView.as_view(), name='detail'), -) +] diff --git a/openstack_dashboard/dashboards/project/access_and_security/security_groups/urls.py b/openstack_dashboard/dashboards/project/access_and_security/security_groups/urls.py index 77a3bf7492..456bc0f622 100644 --- a/openstack_dashboard/dashboards/project/access_and_security/security_groups/urls.py +++ b/openstack_dashboard/dashboards/project/access_and_security/security_groups/urls.py @@ -16,15 +16,13 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.project.access_and_security.\ security_groups import views -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^create/$', views.CreateView.as_view(), name='create'), url(r'^(?P[^/]+)/$', views.DetailView.as_view(), @@ -35,4 +33,4 @@ urlpatterns = patterns( url(r'^(?P[^/]+)/update/$', views.UpdateView.as_view(), name='update') -) +] diff --git a/openstack_dashboard/dashboards/project/access_and_security/urls.py b/openstack_dashboard/dashboards/project/access_and_security/urls.py index 30880088b0..5461791432 100644 --- a/openstack_dashboard/dashboards/project/access_and_security/urls.py +++ b/openstack_dashboard/dashboards/project/access_and_security/urls.py @@ -17,7 +17,6 @@ # under the License. from django.conf.urls import include -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.project.access_and_security.\ @@ -31,12 +30,11 @@ from openstack_dashboard.dashboards.project.access_and_security.\ from openstack_dashboard.dashboards.project.access_and_security import views -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^$', views.IndexView.as_view(), name='index'), url(r'api_access/', include(api_access_urls, namespace='api_access')), url(r'keypairs/', include(keypair_urls, namespace='keypairs')), url(r'floating_ips/', include(fip_urls, namespace='floating_ips')), url(r'security_groups/', include(sec_group_urls, namespace='security_groups')), -) +] diff --git a/openstack_dashboard/dashboards/project/containers/urls.py b/openstack_dashboard/dashboards/project/containers/urls.py index ff390c8787..fa43f96e35 100644 --- a/openstack_dashboard/dashboards/project/containers/urls.py +++ b/openstack_dashboard/dashboards/project/containers/urls.py @@ -17,14 +17,10 @@ # under the License. from django.conf import settings -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.project.containers import views - -VIEW_MOD = 'openstack_dashboard.dashboards.project.containers.views' - if settings.HORIZON_CONFIG['swift_panel'] == 'angular': # New angular containers and objects urlpatterns = [ @@ -36,8 +32,7 @@ if settings.HORIZON_CONFIG['swift_panel'] == 'angular': ] else: # Legacy swift containers and objects - urlpatterns = patterns( - VIEW_MOD, + urlpatterns = [ url(r'^((?P.+?)/)?(?P(.+/)+)?$', views.ContainerView.as_view(), name='index'), @@ -75,6 +70,6 @@ else: name='object_copy'), url(r'^(?P[^/]+)/(?P.+)/download$', - 'object_download', + views.object_download, name='object_download'), - ) + ] diff --git a/openstack_dashboard/dashboards/project/firewalls/urls.py b/openstack_dashboard/dashboards/project/firewalls/urls.py index dc04b2f274..e0acac008f 100644 --- a/openstack_dashboard/dashboards/project/firewalls/urls.py +++ b/openstack_dashboard/dashboards/project/firewalls/urls.py @@ -12,13 +12,11 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.project.firewalls import views -urlpatterns = patterns( - 'openstack_dashboard.dashboards.project.firewalls.views', +urlpatterns = [ url(r'^$', views.IndexView.as_view(), name='index'), url(r'^\?tab=fwtabs__firewalls$', views.IndexView.as_view(), name='firewalls'), @@ -49,4 +47,5 @@ urlpatterns = patterns( url(r'^removerouter/(?P[^/]+)/$', views.RemoveRouterFromFirewallView.as_view(), name='removerouter'), url(r'^firewall/(?P[^/]+)/$', - views.FirewallDetailsView.as_view(), name='firewalldetails')) + views.FirewallDetailsView.as_view(), name='firewalldetails'), +] diff --git a/openstack_dashboard/dashboards/project/images/images/urls.py b/openstack_dashboard/dashboards/project/images/images/urls.py index c7f95491be..7e63484b60 100644 --- a/openstack_dashboard/dashboards/project/images/images/urls.py +++ b/openstack_dashboard/dashboards/project/images/images/urls.py @@ -16,19 +16,14 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.project.images.images import views -VIEWS_MOD = 'openstack_dashboard.dashboards.project.images.images.views' - - -urlpatterns = patterns( - VIEWS_MOD, +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'), -) +] diff --git a/openstack_dashboard/dashboards/project/images/snapshots/urls.py b/openstack_dashboard/dashboards/project/images/snapshots/urls.py index b8caa34687..45885813ee 100644 --- a/openstack_dashboard/dashboards/project/images/snapshots/urls.py +++ b/openstack_dashboard/dashboards/project/images/snapshots/urls.py @@ -16,15 +16,13 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.project.images.snapshots import views -urlpatterns = patterns( - '', +urlpatterns = [ url(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 da3bef83dd..71ded710e0 100644 --- a/openstack_dashboard/dashboards/project/images/urls.py +++ b/openstack_dashboard/dashboards/project/images/urls.py @@ -17,7 +17,6 @@ # under the License. from django.conf.urls import include -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.project.images.images \ @@ -27,9 +26,8 @@ from openstack_dashboard.dashboards.project.images.snapshots \ from openstack_dashboard.dashboards.project.images import views -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^$', views.IndexView.as_view(), name='index'), url(r'', include(image_urls, namespace='images')), url(r'', include(snapshot_urls, namespace='snapshots')), -) +] diff --git a/openstack_dashboard/dashboards/project/instances/urls.py b/openstack_dashboard/dashboards/project/instances/urls.py index e89c9a17ab..efaf7180ec 100644 --- a/openstack_dashboard/dashboards/project/instances/urls.py +++ b/openstack_dashboard/dashboards/project/instances/urls.py @@ -16,7 +16,6 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.project.instances import views @@ -24,11 +23,8 @@ from openstack_dashboard.dashboards.project.instances import views INSTANCES = r'^(?P[^/]+)/%s$' INSTANCES_KEYPAIR = r'^(?P[^/]+)/(?P[^/]+)/%s$' -VIEW_MOD = 'openstack_dashboard.dashboards.project.instances.views' - -urlpatterns = patterns( - VIEW_MOD, +urlpatterns = [ url(r'^$', views.IndexView.as_view(), name='index'), url(r'^launch$', views.LaunchInstanceView.as_view(), name='launch'), url(r'^(?P[^/]+)/$', @@ -37,10 +33,10 @@ urlpatterns = patterns( url(INSTANCES % 'rebuild', views.RebuildView.as_view(), name='rebuild'), url(INSTANCES % 'serial', views.SerialConsoleView.as_view(), name='serial'), - url(INSTANCES % 'console', 'console', name='console'), - url(INSTANCES % 'vnc', 'vnc', name='vnc'), - url(INSTANCES % 'spice', 'spice', name='spice'), - url(INSTANCES % 'rdp', 'rdp', name='rdp'), + url(INSTANCES % 'console', views.console, name='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'), @@ -48,4 +44,4 @@ urlpatterns = patterns( views.AttachInterfaceView.as_view(), name='attach_interface'), url(INSTANCES % 'detach_interface', views.DetachInterfaceView.as_view(), name='detach_interface'), -) +] diff --git a/openstack_dashboard/dashboards/project/loadbalancers/urls.py b/openstack_dashboard/dashboards/project/loadbalancers/urls.py index 62b47efb25..af7d6bcc8a 100644 --- a/openstack_dashboard/dashboards/project/loadbalancers/urls.py +++ b/openstack_dashboard/dashboards/project/loadbalancers/urls.py @@ -12,14 +12,12 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.project.loadbalancers import views -urlpatterns = patterns( - 'openstack_dashboard.dashboards.project.loadbalancers.views', +urlpatterns = [ url(r'^$', views.IndexView.as_view(), name='index'), url(r'^\?tab=lbtabs__members$', views.IndexView.as_view(), name='members'), url(r'^\?tab=lbtabs__monitors$', @@ -48,4 +46,5 @@ urlpatterns = patterns( url(r'^member/(?P[^/]+)/$', views.MemberDetailsView.as_view(), name='memberdetails'), url(r'^monitor/(?P[^/]+)/$', - views.MonitorDetailsView.as_view(), name='monitordetails')) + views.MonitorDetailsView.as_view(), name='monitordetails'), +] diff --git a/openstack_dashboard/dashboards/project/network_topology/urls.py b/openstack_dashboard/dashboards/project/network_topology/urls.py index 148c56b44f..95c5453af8 100644 --- a/openstack_dashboard/dashboards/project/network_topology/urls.py +++ b/openstack_dashboard/dashboards/project/network_topology/urls.py @@ -16,15 +16,12 @@ # License for the specific language governing permissions and limitations # under the License. - -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.project.network_topology import views -urlpatterns = patterns( - 'openstack_dashboard.dashboards.project.network_topology.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'), @@ -44,4 +41,4 @@ urlpatterns = patterns( name='createnetwork'), url(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 eb64556ba2..c02db8c2fe 100644 --- a/openstack_dashboard/dashboards/project/networks/ports/urls.py +++ b/openstack_dashboard/dashboards/project/networks/ports/urls.py @@ -12,17 +12,13 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.project.networks.ports import views PORTS = r'^(?P[^/]+)/%s$' -VIEW_MOD = 'openstack_dashboard.dashboards.project.networks.ports.views' - -urlpatterns = patterns( - VIEW_MOD, - url(PORTS % 'detail', views.DetailView.as_view(), name='detail') -) +urlpatterns = [ + url(PORTS % 'detail', views.DetailView.as_view(), name='detail'), +] diff --git a/openstack_dashboard/dashboards/project/networks/subnets/urls.py b/openstack_dashboard/dashboards/project/networks/subnets/urls.py index 7a4332caa7..8f187d6f76 100644 --- a/openstack_dashboard/dashboards/project/networks/subnets/urls.py +++ b/openstack_dashboard/dashboards/project/networks/subnets/urls.py @@ -12,17 +12,13 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.project.networks.subnets import views SUBNETS = r'^(?P[^/]+)/%s$' -VIEW_MOD = 'openstack_dashboard.dashboards.project.networks.subnets.views' - -urlpatterns = patterns( - VIEW_MOD, - url(SUBNETS % 'detail', views.DetailView.as_view(), name='detail') -) +urlpatterns = [ + url(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 5e791e8704..0b7e4924c3 100644 --- a/openstack_dashboard/dashboards/project/networks/urls.py +++ b/openstack_dashboard/dashboards/project/networks/urls.py @@ -13,7 +13,6 @@ # under the License. from django.conf.urls import include -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.project.networks.ports \ @@ -30,8 +29,7 @@ from openstack_dashboard.dashboards.project.networks import views NETWORKS = r'^(?P[^/]+)/%s$' -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^$', views.IndexView.as_view(), name='index'), url(r'^create$', views.CreateView.as_view(), name='create'), url(NETWORKS % 'detail', views.DetailView.as_view(), name='detail'), @@ -43,4 +41,5 @@ urlpatterns = patterns( url(r'^(?P[^/]+)/ports/(?P[^/]+)/update$', port_views.UpdateView.as_view(), name='editport'), url(r'^subnets/', include(subnet_urls, namespace='subnets')), - url(r'^ports/', include(port_urls, namespace='ports'))) + url(r'^ports/', include(port_urls, namespace='ports')), +] diff --git a/openstack_dashboard/dashboards/project/ngimages/urls.py b/openstack_dashboard/dashboards/project/ngimages/urls.py index daa27b6b2a..82ed6966f8 100644 --- a/openstack_dashboard/dashboards/project/ngimages/urls.py +++ b/openstack_dashboard/dashboards/project/ngimages/urls.py @@ -12,13 +12,11 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.project.ngimages import views -urlpatterns = patterns( - 'openstack_dashboard.dashboards.project.ngimages.views', +urlpatterns = [ url('', views.IndexView.as_view(), name='index'), -) +] diff --git a/openstack_dashboard/dashboards/project/overview/urls.py b/openstack_dashboard/dashboards/project/overview/urls.py index aeaf65104c..f70a943762 100644 --- a/openstack_dashboard/dashboards/project/overview/urls.py +++ b/openstack_dashboard/dashboards/project/overview/urls.py @@ -16,15 +16,12 @@ # License for the specific language governing permissions and limitations # under the License. - -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.project.overview import views -urlpatterns = patterns( - 'openstack_dashboard.dashboards.project.overview.views', +urlpatterns = [ url(r'^$', views.ProjectOverview.as_view(), name='index'), url(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 a23c039b74..30904c00a7 100644 --- a/openstack_dashboard/dashboards/project/routers/ports/urls.py +++ b/openstack_dashboard/dashboards/project/routers/ports/urls.py @@ -12,13 +12,12 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.project.routers.ports import views PORTS = r'^(?P[^/]+)/%s$' -urlpatterns = patterns( - 'horizon.dashboards.project.networks.ports.views', - url(PORTS % 'detail', views.DetailView.as_view(), name='detail')) +urlpatterns = [ + url(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 cd700e6aa5..a597e8eb7f 100644 --- a/openstack_dashboard/dashboards/project/routers/urls.py +++ b/openstack_dashboard/dashboards/project/routers/urls.py @@ -12,7 +12,6 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.project.routers.extensions.extraroutes\ @@ -27,8 +26,7 @@ from openstack_dashboard.dashboards.project.routers import views ROUTER_URL = r'^(?P[^/]+)/%s' -urlpatterns = patterns( - 'horizon.dashboards.project.routers.views', +urlpatterns = [ url(r'^$', views.IndexView.as_view(), name='index'), url(r'^create/$', views.CreateView.as_view(), name='create'), url(ROUTER_URL % '$', @@ -49,4 +47,4 @@ urlpatterns = patterns( url(ROUTER_URL % 'setgateway', port_views.SetGatewayView.as_view(), name='setgateway'), -) +] diff --git a/openstack_dashboard/dashboards/project/stacks/resource_types/urls.py b/openstack_dashboard/dashboards/project/stacks/resource_types/urls.py index 818598be38..8ab8cb0bda 100644 --- a/openstack_dashboard/dashboards/project/stacks/resource_types/urls.py +++ b/openstack_dashboard/dashboards/project/stacks/resource_types/urls.py @@ -11,14 +11,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.project.stacks.resource_types import views -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^$', views.ResourceTypesView.as_view(), name='index'), url(r'^(?P[^/]+)/$', views.DetailView.as_view(), name='details'), -) +] diff --git a/openstack_dashboard/dashboards/project/stacks/urls.py b/openstack_dashboard/dashboards/project/stacks/urls.py index 55e8c6858a..c63a18fe62 100644 --- a/openstack_dashboard/dashboards/project/stacks/urls.py +++ b/openstack_dashboard/dashboards/project/stacks/urls.py @@ -10,13 +10,11 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.project.stacks import views -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^$', views.IndexView.as_view(), name='index'), url(r'^select_template$', views.SelectTemplateView.as_view(), @@ -37,4 +35,4 @@ urlpatterns = patterns( views.ResourceView.as_view(), name='resource'), url(r'^get_d3_data/(?P[^/]+)/$', views.JSONView.as_view(), name='d3_data'), -) +] diff --git a/openstack_dashboard/dashboards/project/volumes/backups/urls.py b/openstack_dashboard/dashboards/project/volumes/backups/urls.py index b0c8d6c384..97c190df1a 100644 --- a/openstack_dashboard/dashboards/project/volumes/backups/urls.py +++ b/openstack_dashboard/dashboards/project/volumes/backups/urls.py @@ -10,22 +10,16 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.project.volumes.backups import views -VIEWS_MOD = ('openstack_dashboard.dashboards.project' - '.volumes.backups.views') - - -urlpatterns = patterns( - VIEWS_MOD, +urlpatterns = [ url(r'^(?P[^/]+)/$', views.BackupDetailView.as_view(), name='detail'), url(r'^(?P[^/]+)/restore/$', views.RestoreBackupView.as_view(), name='restore'), -) +] diff --git a/openstack_dashboard/dashboards/project/volumes/cgroups/urls.py b/openstack_dashboard/dashboards/project/volumes/cgroups/urls.py index 9d27fc75e5..b8fe8e023a 100644 --- a/openstack_dashboard/dashboards/project/volumes/cgroups/urls.py +++ b/openstack_dashboard/dashboards/project/volumes/cgroups/urls.py @@ -10,14 +10,12 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.project.volumes.cgroups import views -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^create/$', views.CreateView.as_view(), name='create'), @@ -30,4 +28,4 @@ urlpatterns = patterns( url(r'^(?P[^/]+)$', views.DetailView.as_view(), name='detail'), -) +] diff --git a/openstack_dashboard/dashboards/project/volumes/snapshots/urls.py b/openstack_dashboard/dashboards/project/volumes/snapshots/urls.py index c4279cfd21..335f103dfa 100644 --- a/openstack_dashboard/dashboards/project/volumes/snapshots/urls.py +++ b/openstack_dashboard/dashboards/project/volumes/snapshots/urls.py @@ -10,18 +10,16 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.project.volumes.snapshots import views -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^(?P[^/]+)$', views.DetailView.as_view(), name='detail'), url(r'^(?P[^/]+)/update/$', views.UpdateView.as_view(), name='update'), -) +] diff --git a/openstack_dashboard/dashboards/project/volumes/urls.py b/openstack_dashboard/dashboards/project/volumes/urls.py index 22287c5cb0..ad4ef68140 100644 --- a/openstack_dashboard/dashboards/project/volumes/urls.py +++ b/openstack_dashboard/dashboards/project/volumes/urls.py @@ -13,7 +13,6 @@ # under the License. from django.conf.urls import include -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.project.volumes.backups \ @@ -26,8 +25,7 @@ from openstack_dashboard.dashboards.project.volumes import views from openstack_dashboard.dashboards.project.volumes.volumes \ import urls as volume_urls -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^$', views.IndexView.as_view(), name='index'), url(r'^\?tab=volumes_and_snapshots__snapshots_tab$', views.IndexView.as_view(), name='snapshots_tab'), @@ -41,4 +39,4 @@ urlpatterns = patterns( url(r'backups/', include(backups_urls, namespace='backups')), url(r'snapshots/', include(snapshot_urls, namespace='snapshots')), url(r'cgroups/', include(cgroup_urls, namespace='cgroups')), -) +] diff --git a/openstack_dashboard/dashboards/project/volumes/volumes/urls.py b/openstack_dashboard/dashboards/project/volumes/volumes/urls.py index f8a44eb18a..0255a97d2f 100644 --- a/openstack_dashboard/dashboards/project/volumes/volumes/urls.py +++ b/openstack_dashboard/dashboards/project/volumes/volumes/urls.py @@ -12,7 +12,6 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.project.volumes \ @@ -21,10 +20,7 @@ from openstack_dashboard.dashboards.project.volumes.backups \ import views as backup_views -VIEWS_MOD = ('openstack_dashboard.dashboards.project.volumes.volumes.views') - -urlpatterns = patterns( - VIEWS_MOD, +urlpatterns = [ url(r'^create/$', views.CreateView.as_view(), name='create'), url(r'^(?P[^/]+)/extend/$', views.ExtendView.as_view(), @@ -62,4 +58,4 @@ urlpatterns = patterns( url(r'^(?P[^/]+)/encryption_detail/$', views.EncryptionDetailView.as_view(), name='encryption_detail'), -) +] diff --git a/openstack_dashboard/dashboards/project/vpn/urls.py b/openstack_dashboard/dashboards/project/vpn/urls.py index e4d0e31152..918020aab0 100644 --- a/openstack_dashboard/dashboards/project/vpn/urls.py +++ b/openstack_dashboard/dashboards/project/vpn/urls.py @@ -12,13 +12,11 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.project.vpn import views -urlpatterns = patterns( - 'openstack_dashboard.dashboards.project.vpn.views', +urlpatterns = [ url(r'^$', views.IndexView.as_view(), name='index'), url(r'^addikepolicy$', views.AddIKEPolicyView.as_view(), name='addikepolicy'), @@ -46,4 +44,5 @@ urlpatterns = patterns( views.VPNServiceDetailsView.as_view(), name='vpnservicedetails'), url(r'^ipsecsiteconnection/(?P[^/]+)/$', views.IPSecSiteConnectionDetailsView.as_view(), - name='ipsecsiteconnectiondetails')) + name='ipsecsiteconnectiondetails'), +] diff --git a/openstack_dashboard/dashboards/settings/password/urls.py b/openstack_dashboard/dashboards/settings/password/urls.py index 9987814787..2b74d544a7 100644 --- a/openstack_dashboard/dashboards/settings/password/urls.py +++ b/openstack_dashboard/dashboards/settings/password/urls.py @@ -12,12 +12,11 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.settings.password import views -urlpatterns = patterns( - '', - url(r'^$', views.PasswordView.as_view(), name='index')) +urlpatterns = [ + url(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 33c0115f8f..1dd7753646 100644 --- a/openstack_dashboard/dashboards/settings/user/urls.py +++ b/openstack_dashboard/dashboards/settings/user/urls.py @@ -12,12 +12,11 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.settings.user import views -urlpatterns = patterns( - '', - url(r'^$', views.UserSettingsView.as_view(), name='index')) +urlpatterns = [ + url(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 906c2b9f3e..28f5ba85dc 100644 --- a/openstack_dashboard/test/error_pages_urls.py +++ b/openstack_dashboard/test/error_pages_urls.py @@ -1,8 +1,6 @@ -from django.conf.urls import patterns +from django.conf.urls import url +from django.views import defaults from openstack_dashboard.urls import urlpatterns # noqa -urlpatterns += patterns( - '', - (r'^500/$', 'django.views.defaults.server_error') -) +urlpatterns.append(url(r'^500/$', defaults.server_error)) diff --git a/openstack_dashboard/test/test_panels/another_panel/urls.py b/openstack_dashboard/test/test_panels/another_panel/urls.py index 862857fd3b..f3f16d85c8 100644 --- a/openstack_dashboard/test/test_panels/another_panel/urls.py +++ b/openstack_dashboard/test/test_panels/another_panel/urls.py @@ -10,12 +10,10 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.test.test_panels.another_panel import views -urlpatterns = patterns( - '', +urlpatterns = [ url(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 31b24bf81a..dbfbf51117 100644 --- a/openstack_dashboard/test/test_panels/nonloading_panel/urls.py +++ b/openstack_dashboard/test/test_panels/nonloading_panel/urls.py @@ -10,12 +10,10 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.test.test_panels.nonloading_panel import views -urlpatterns = patterns( - '', +urlpatterns = [ url(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 136af6413d..848017c7db 100644 --- a/openstack_dashboard/test/test_panels/plugin_panel/urls.py +++ b/openstack_dashboard/test/test_panels/plugin_panel/urls.py @@ -10,12 +10,10 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.test.test_panels.plugin_panel import views -urlpatterns = patterns( - '', +urlpatterns = [ url(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 277a98229b..709b66b32e 100644 --- a/openstack_dashboard/test/test_panels/second_panel/urls.py +++ b/openstack_dashboard/test/test_panels/second_panel/urls.py @@ -10,12 +10,10 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.test.test_panels.second_panel import views -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^$', views.IndexView.as_view(), name='index'), -) +] diff --git a/openstack_dashboard/test/urls.py b/openstack_dashboard/test/urls.py index 79552c9460..0aa7c6043c 100644 --- a/openstack_dashboard/test/urls.py +++ b/openstack_dashboard/test/urls.py @@ -19,23 +19,24 @@ URL patterns for the OpenStack Dashboard. from django.conf import settings from django.conf.urls import include -from django.conf.urls import patterns from django.conf.urls.static import static # noqa from django.conf.urls import url from django.contrib.staticfiles.urls import staticfiles_urlpatterns # noqa +from django.views import defaults +from openstack_dashboard.api import rest from openstack_dashboard.test.jasmine import jasmine +from openstack_dashboard import views import horizon -urlpatterns = patterns( - '', - url(r'^$', 'openstack_dashboard.views.splash', name='splash'), +urlpatterns = [ + url(r'^$', views.splash, name='splash'), url(r'^auth/', include('openstack_auth.urls')), - url(r'^api/', include('openstack_dashboard.api.rest.urls')), + url(r'^api/', include(rest.urls)), url(r'^jasmine/(.*?)$', jasmine.dispatcher), url(r'', include(horizon.urls)), -) +] # Development static app and project media serving using the staticfiles app. urlpatterns += staticfiles_urlpatterns() @@ -46,7 +47,4 @@ urlpatterns += staticfiles_urlpatterns() urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) if settings.DEBUG: - urlpatterns += patterns( - '', - url(r'^500/$', 'django.views.defaults.server_error') - ) + urlpatterns.append(url(r'^500/$', defaults.server_error)) diff --git a/openstack_dashboard/urls.py b/openstack_dashboard/urls.py index beef71e4cf..67717c1f5c 100644 --- a/openstack_dashboard/urls.py +++ b/openstack_dashboard/urls.py @@ -22,25 +22,24 @@ URL patterns for the OpenStack Dashboard. from django.conf import settings from django.conf.urls import include -from django.conf.urls import patterns from django.conf.urls.static import static # noqa from django.conf.urls import url from django.contrib.staticfiles.urls import staticfiles_urlpatterns # noqa +from django.views import defaults import horizon -urlpatterns = patterns( - '', - url(r'^$', 'openstack_dashboard.views.splash', name='splash'), - url(r'^api/', include('openstack_dashboard.api.rest.urls')), +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'', include(horizon.urls)), -) +] for u in getattr(settings, 'AUTHENTICATION_URLS', ['openstack_auth.urls']): - urlpatterns += patterns( - '', - url(r'^auth/', include(u)) - ) + urlpatterns.append(url(r'^auth/', include(u))) # Development static app and project media serving using the staticfiles app. urlpatterns += staticfiles_urlpatterns() @@ -51,7 +50,4 @@ urlpatterns += staticfiles_urlpatterns() urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) if settings.DEBUG: - urlpatterns += patterns( - '', - url(r'^500/$', 'django.views.defaults.server_error') - ) + urlpatterns.append(url(r'^500/$', defaults.server_error))