From cfa9fd6066e17479bfda0fc93b8aff88d2028ea4 Mon Sep 17 00:00:00 2001 From: Bandic007 Date: Fri, 6 Jul 2018 14:16:45 +0300 Subject: [PATCH 1/5] initial comit --- README.md | 17 ++++++++++++++++- accounts/urls.py | 9 ++++++--- instances/views.py | 2 +- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ae44568..158145a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,15 @@ -## WebVirtCloud Beta +## WebVirtCloud - Bandic007 (B7) updated and fixed edition +## Credits +This version of WebVirtCloud was forked from [@catborise](https://github.com/catborise/webvirtcloud) repo, which is a forked and modified (with upgrades of UI and functionality) versio of [@retspen](https://github.com/retspen/webvirtcloud) repo. +Thanks to both of them for the amazing job they did! + +The B7 version in this repo has some fixes applied on problems from the upgraded [@catborise](https://github.com/catborise/webvirtcloud) repo. They were: +* fixed not working login page +* fixed not working (loading) "Instances" page + +This version will always be updated with the latest changes from both repos and I will try to apply fixes to all bugs I find, in order to make it always running from the first time you deploy it! +Also, I will escalate "Pull requests" to both those guys in order to offer them my fixes in thei repos! ## Features @@ -230,11 +240,16 @@ datasource: ### How To Update ```bash +cd /srv/webvirtcloud git pull +virtualenv venv +source venv/bin/activate python manage.py migrate sudo service supervisor restart +deactivate ``` ### License WebVirtCloud is licensed under the [Apache Licence, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html). + diff --git a/accounts/urls.py b/accounts/urls.py index 00bdefe..9cc9682 100644 --- a/accounts/urls.py +++ b/accounts/urls.py @@ -4,8 +4,11 @@ from django.contrib.auth import views as auth_views from . import views urlpatterns = [ - url(r'^login/$', auth_views.LoginView.as_view(template_name='login.html'), name='login'), - url(r'^logout/$', auth_views.LogoutView.as_view(template_name='logout.html'), name='logout'), - url(r'^profile/$', views.profile, name='profile'), url(r'^$', views.accounts, name='accounts'), + 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/(?P[0-9]+)/$', views.account, name='account'), ] diff --git a/instances/views.py b/instances/views.py index 78fafa6..1c6fe3c 100644 --- a/instances/views.py +++ b/instances/views.py @@ -85,7 +85,7 @@ def instances(request): comp_info["mem_size"], comp_info["mem_perc"]][vm]['userinstances'] = get_userinstances_info(check_uuid) except Instance.DoesNotExist: - check_uuid = Instance(compute_id=comp.id, name=vm, uuid=info['uuid']) + check_uuid = Instance(compute_id=comp["id"], name=vm, uuid=info['uuid']) check_uuid.save() if not request.user.is_superuser: From 1204c6d1b4096d3dfc756fbd3419fa774ecf83eb Mon Sep 17 00:00:00 2001 From: Bandic007 Date: Fri, 6 Jul 2018 14:18:12 +0300 Subject: [PATCH 2/5] return original README file --- README.md | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/README.md b/README.md index 158145a..ae44568 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,5 @@ -## WebVirtCloud - Bandic007 (B7) updated and fixed edition +## WebVirtCloud Beta -## Credits -This version of WebVirtCloud was forked from [@catborise](https://github.com/catborise/webvirtcloud) repo, which is a forked and modified (with upgrades of UI and functionality) versio of [@retspen](https://github.com/retspen/webvirtcloud) repo. -Thanks to both of them for the amazing job they did! - -The B7 version in this repo has some fixes applied on problems from the upgraded [@catborise](https://github.com/catborise/webvirtcloud) repo. They were: -* fixed not working login page -* fixed not working (loading) "Instances" page - -This version will always be updated with the latest changes from both repos and I will try to apply fixes to all bugs I find, in order to make it always running from the first time you deploy it! -Also, I will escalate "Pull requests" to both those guys in order to offer them my fixes in thei repos! ## Features @@ -240,16 +230,11 @@ datasource: ### How To Update ```bash -cd /srv/webvirtcloud git pull -virtualenv venv -source venv/bin/activate python manage.py migrate sudo service supervisor restart -deactivate ``` ### License WebVirtCloud is licensed under the [Apache Licence, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html). - From 3628e5f355b6060a5759e6206a175862faab971e Mon Sep 17 00:00:00 2001 From: Bandic007 Date: Fri, 6 Jul 2018 15:48:38 +0300 Subject: [PATCH 3/5] fixing django version to 1.11.14 + other --- accounts/urls.py | 9 +++------ conf/requirements.txt | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/accounts/urls.py b/accounts/urls.py index 9cc9682..00bdefe 100644 --- a/accounts/urls.py +++ b/accounts/urls.py @@ -4,11 +4,8 @@ from django.contrib.auth import views as auth_views 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'^login/$', auth_views.LoginView.as_view(template_name='login.html'), name='login'), + url(r'^logout/$', auth_views.LogoutView.as_view(template_name='logout.html'), name='logout'), + url(r'^profile/$', views.profile, name='profile'), url(r'^$', views.accounts, name='accounts'), url(r'^profile/(?P[0-9]+)/$', views.account, name='account'), ] diff --git a/conf/requirements.txt b/conf/requirements.txt index acfaaed..e562fe4 100644 --- a/conf/requirements.txt +++ b/conf/requirements.txt @@ -1,4 +1,4 @@ -Django==1.8.11 +Django==1.11.14 websockify==0.8.0 gunicorn==19.3.0 libvirt-python==3.10 From 904df30386315fdb391516d55b63508a706a8417 Mon Sep 17 00:00:00 2001 From: Bandic007 Date: Fri, 6 Jul 2018 15:56:11 +0300 Subject: [PATCH 4/5] adding new django version to update procedure --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ae44568..62fbc5f 100644 --- a/README.md +++ b/README.md @@ -231,6 +231,7 @@ datasource: ### How To Update ```bash git pull +pip install Django==1.11.14 python manage.py migrate sudo service supervisor restart ``` From 32b03b71847ac92cf18adac04cf5e5fcea484f13 Mon Sep 17 00:00:00 2001 From: Bandic007 Date: Fri, 6 Jul 2018 17:26:57 +0300 Subject: [PATCH 5/5] adding new django version to update procedure, fixing missing deps --- conf/requirements.txt | 5 +++-- webvirtcloud/settings.py.template | 10 +++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/conf/requirements.txt b/conf/requirements.txt index e562fe4..d395575 100644 --- a/conf/requirements.txt +++ b/conf/requirements.txt @@ -1,5 +1,6 @@ Django==1.11.14 websockify==0.8.0 -gunicorn==19.3.0 -libvirt-python==3.10 +gunicorn==19.9.0 +libvirt-python==4.4.0 libxml2-python3==2.9.5 +lxml==4.2.3 diff --git a/webvirtcloud/settings.py.template b/webvirtcloud/settings.py.template index b7ba1ea..ffee758 100644 --- a/webvirtcloud/settings.py.template +++ b/webvirtcloud/settings.py.template @@ -83,7 +83,15 @@ TEMPLATES = [ 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [ os.path.join(BASE_DIR, 'templates'), ], 'APP_DIRS': True, - } + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, ] ## WebVirtCloud settings