From 8b39d4e4299835892be9de181ae72033bb48c3a4 Mon Sep 17 00:00:00 2001 From: Retspen Date: Thu, 2 Apr 2015 09:37:46 +0300 Subject: [PATCH] Adde urls for app --- accounts/urls.py | 10 ++++++++++ computes/urls.py | 8 ++++++++ conf/requirements.txt | 2 +- dev/requirements.txt | 2 +- instances/urls.py | 8 ++++++++ vrtManager/instance.py | 3 ++- webvirtcloud/settings-dev.py | 4 ++-- webvirtcloud/urls.py | 24 ++++++------------------ 8 files changed, 38 insertions(+), 23 deletions(-) create mode 100644 accounts/urls.py create mode 100644 computes/urls.py create mode 100644 instances/urls.py diff --git a/accounts/urls.py b/accounts/urls.py new file mode 100644 index 0000000..52052ee --- /dev/null +++ b/accounts/urls.py @@ -0,0 +1,10 @@ +from django.conf.urls import url +from . import views + +urlpatterns =[ + url(r'^login/$', 'django.contrib.auth.views.login', {'template_name': 'login.html'}, name='login'), + url(r'^logout/$', 'django.contrib.auth.views.logout', {'template_name': 'logout.html'}, name='logout'), + url(r'^profile/$', views.profile, name='profile'), + url(r'^$', views.accounts, name='accounts'), + url(r'^profile/(\d+)/$', views.account, name='account'), +] diff --git a/computes/urls.py b/computes/urls.py new file mode 100644 index 0000000..9e4da9f --- /dev/null +++ b/computes/urls.py @@ -0,0 +1,8 @@ +from django.conf.urls import url +from . import views + +urlpatterns =[ + url(r'^$', views.computes, name='computes'), + url(r'^overview/(\d+)/$', views.overview, name='overview'), + url(r'^statistics/(\d+)/$', views.compute_graph, name='compute_graph'), +] diff --git a/conf/requirements.txt b/conf/requirements.txt index b402a8b..fcae85c 100644 --- a/conf/requirements.txt +++ b/conf/requirements.txt @@ -1,3 +1,3 @@ -Django==1.7.7 +Django==1.8 websockify==0.6.0 gunicorn==19.3.0 diff --git a/dev/requirements.txt b/dev/requirements.txt index 0a40713..14d220c 100644 --- a/dev/requirements.txt +++ b/dev/requirements.txt @@ -1,4 +1,4 @@ -Django==1.7.7 +Django==1.8 websockify==0.6.0 pep8==1.6.2 pyflakes==0.8.1 diff --git a/instances/urls.py b/instances/urls.py new file mode 100644 index 0000000..2963d3d --- /dev/null +++ b/instances/urls.py @@ -0,0 +1,8 @@ +from django.conf.urls import url +from . import views + +urlpatterns =[ + url(r'^(\d+)/([\w\-\.]+)/$', views.instance, name='instance'), + url(r'^statistics/(\d+)/([\w\-\.]+)/$', views.inst_graph, name='inst_graph'), + url(r'^status/(\d+)/([\w\-\.]+)/$', views.inst_status, name='inst_status'), +] diff --git a/vrtManager/instance.py b/vrtManager/instance.py index 49baf4a..e16b567 100644 --- a/vrtManager/instance.py +++ b/vrtManager/instance.py @@ -215,7 +215,8 @@ class wvmInstance(wvmConnect): pass finally: result.append( - {'dev': dev, 'image': volume, 'storage': storage, 'path': src_fl, 'format': disk_format, 'size': disk_size}) + {'dev': dev, 'image': volume, 'storage': storage, 'path': src_fl, + 'format': disk_format, 'size': disk_size}) return result return util.get_xml_path(self._XMLDesc(0), func=disks) diff --git a/webvirtcloud/settings-dev.py b/webvirtcloud/settings-dev.py index 749ce09..ab4c2cb 100644 --- a/webvirtcloud/settings-dev.py +++ b/webvirtcloud/settings-dev.py @@ -3,7 +3,7 @@ Django dev settings for webvirtcloud project. """ -from settings import * +from webvirtcloud.settings import * DEBUG = True -TEMPLATE_DEBUG = True \ No newline at end of file +TEMPLATE_DEBUG = True diff --git a/webvirtcloud/urls.py b/webvirtcloud/urls.py index f9d07f2..3bc6c35 100644 --- a/webvirtcloud/urls.py +++ b/webvirtcloud/urls.py @@ -1,22 +1,12 @@ from django.conf.urls import patterns, include, url -from django.contrib import admin +# from django.contrib import admin urlpatterns = patterns('', - url(r'^accounts/login/$', 'django.contrib.auth.views.login', {'template_name': 'login.html'}, name='login'), - url(r'^accounts/logout/$', 'django.contrib.auth.views.logout', {'template_name': 'logout.html'}, name='logout'), - url(r'^accounts/profile/$', 'accounts.views.profile', name='profile'), - url(r'^accounts/$', 'accounts.views.accounts', name='accounts'), - url(r'^accounts/profile/(\d+)/$', 'accounts.views.account', name='account'), - url(r'^$', 'instances.views.index', name='index'), - url(r'^instances$', 'instances.views.instances', name='instances'), - url(r'^instance/(\d+)/([\w\-\.]+)/$', 'instances.views.instance', name='instance'), - - url(r'^instance/statistics/(\d+)/([\w\-\.]+)/$', 'instances.views.inst_graph', name='inst_graph'), - url(r'^instance/status/(\d+)/([\w\-\.]+)/$', 'instances.views.inst_status', name='inst_status'), - - url(r'^computes/$', 'computes.views.computes', name='computes'), - url(r'^compute/overview/(\d+)/$', 'computes.views.overview', name='overview'), + url(r'^instances/$', 'instances.views.instances', name='instances'), + url(r'^instance/', include('instances.urls')), + url(r'^accounts/', include('accounts.urls')), + url(r'^computes/', include('computes.urls')), url(r'^compute/stgs/(\d+)/$', 'storages.views.storages', name='storages'), url(r'^compute/stg/(\d+)/([\w\-\.]+)/$', 'storages.views.storage', name='storage'), @@ -29,10 +19,8 @@ urlpatterns = patterns('', url(r'^compute/secret/(\d+)/$', 'secrets.views.secrets', name='secrets'), - url(r'^compute/statistics/(\d+)/$', 'computes.views.compute_graph', name='compute_graph'), - url(r'^console/$', 'console.views.console', name='console'), url(r'^create/(\d+)/$', 'create.views.create_instance', name='create_instance'), url(r'^logs/$', 'logs.views.showlogs', name='showlogs'), - (r'^admin/', include(admin.site.urls)), + # (r'^admin/', include(admin.site.urls)), )