Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
54a08489
authored
Mar 11, 2013
by
Bence Dányi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cloud: stat context processor
parent
1bde322c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletions
+15
-1
cloud/context_processors.py
+13
-1
cloud/settings.py
+2
-0
No files found.
cloud/context_processors.py
View file @
54a08489
from
cloud.settings
import
DEBUG
from
cloud.settings
import
DEBUG
,
STAT_DEBUG
from
django.core.cache
import
cache
import
subprocess
import
json
def
process_debug
(
req
):
return
{
'DEBUG'
:
DEBUG
}
def
process_stat
(
req
):
# stat = cache.get('cloud_stat');
stat
=
json
.
loads
(
subprocess
.
check_output
([
'/opt/webadmin/cloud/miscellaneous/stat/stat_wrap.sh'
]))
return
{
'STAT_DEBUG'
:
STAT_DEBUG
,
'cloud_stat'
:
stat
,
}
cloud/settings.py
View file @
54a08489
...
...
@@ -3,6 +3,7 @@
DEBUG
=
True
TEMPLATE_DEBUG
=
DEBUG
STAT_DEBUG
=
True
ADMINS
=
(
(
'IK'
,
'cloud@ik.bme.hu'
),
...
...
@@ -119,6 +120,7 @@ TEMPLATE_CONTEXT_PROCESSORS = (
'django.core.context_processors.tz'
,
'django.contrib.messages.context_processors.messages'
,
'cloud.context_processors.process_debug'
,
'cloud.context_processors.process_stat'
,
)
TEMPLATE_DIRS
=
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment