From cfa9fd6066e17479bfda0fc93b8aff88d2028ea4 Mon Sep 17 00:00:00 2001
From: Bandic007 <r.v.mirchev@gmail.com>
Date: Fri, 6 Jul 2018 14:16:45 +0300
Subject: [PATCH] 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<user_id>[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: