From a723bbbc8801bd1ee46208273eb2d94f334d0a24 Mon Sep 17 00:00:00 2001 From: Florian N Date: Wed, 12 Feb 2014 19:57:35 -0500 Subject: [PATCH] fix #7 --- .gitignore | 1 - main/views.py | 3 +-- pydash/settings.py | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 5d92862..634e621 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ *.pyc ._* *.sqlite3 -setting.py diff --git a/main/views.py b/main/views.py index 31eb5f0..428af41 100755 --- a/main/views.py +++ b/main/views.py @@ -222,10 +222,9 @@ def get_cpu_usage(): usage_cpu = element[2] total_usage.append(usage_cpu) - #del total_usage[0] total_usage = sum(float(i) for i in total_usage) - total_free = (100 - float(total_usage)) + total_free = ((100 * int(get_cpus()['cpus'])) - float(total_usage)) cpu_used = {'free': total_free, 'used': float(total_usage), 'all': usage} diff --git a/pydash/settings.py b/pydash/settings.py index 51a6bd1..325bac7 100644 --- a/pydash/settings.py +++ b/pydash/settings.py @@ -18,7 +18,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(__file__)) # See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = '1)$crmowu-23tz@i2-d=7tb3t+1u&(pm!lnjyuarki^72h!3af' +SECRET_KEY = '1)$crmowu-23tz@i2-d=7tb3t+1u&(pm!lnjyuarki^72h!444' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = False