summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastermain/settings.py
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2014-06-26 15:21:42 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-07-14 14:10:03 +0100
commitcff19351a8b9d6267177dc548d994e3f28590391 (patch)
treef8fba60b5b395035c534f2169b3f3ea1e08905f9 /bitbake/lib/toaster/toastermain/settings.py
parent6b62a0fd6eb9a609f71857f5793b0696f7a790b4 (diff)
downloadpoky-cff19351a8b9d6267177dc548d994e3f28590391.tar.gz
bitbake: toaster: add project pages
We add the new project and project page skeletons. In the process, we add an identifier in the settings.py to detect whenever Toaster is running in managed mode, and a context processor to make this value available to the template processor. (Bitbake rev: 927a27c68e24cfe13f62ca5f0e60878b04fa4e24) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastermain/settings.py')
-rw-r--r--bitbake/lib/toaster/toastermain/settings.py19
1 files changed, 15 insertions, 4 deletions
diff --git a/bitbake/lib/toaster/toastermain/settings.py b/bitbake/lib/toaster/toastermain/settings.py
index 97f2ff7cab..09ec2bda98 100644
--- a/bitbake/lib/toaster/toastermain/settings.py
+++ b/bitbake/lib/toaster/toastermain/settings.py
@@ -75,6 +75,11 @@ if 'DATABASE_URL' in os.environ:
75 raise Exception("FIXME: Please implement missing database url schema for url: %s" % dburl) 75 raise Exception("FIXME: Please implement missing database url schema for url: %s" % dburl)
76 76
77 77
78if 'TOASTER_MANAGED' in os.environ and os.environ['TOASTER_MANAGED'] == "1":
79 MANAGED = True
80else:
81 MANAGED = False
82
78# Allows current database settings to be exported as a DATABASE_URL environment variable value 83# Allows current database settings to be exported as a DATABASE_URL environment variable value
79 84
80def getDATABASE_URL(): 85def getDATABASE_URL():
@@ -221,12 +226,11 @@ TEMPLATE_CONTEXT_PROCESSORS = ('django.contrib.auth.context_processors.auth',
221 'django.core.context_processors.static', 226 'django.core.context_processors.static',
222 'django.core.context_processors.tz', 227 'django.core.context_processors.tz',
223 'django.contrib.messages.context_processors.messages', 228 'django.contrib.messages.context_processors.messages',
224 "django.core.context_processors.request") 229 "django.core.context_processors.request",
230 'toastergui.views.managedcontextprocessor',
231 )
225 232
226INSTALLED_APPS = ( 233INSTALLED_APPS = (
227 #'django.contrib.auth',
228 #'django.contrib.contenttypes',
229 #'django.contrib.sessions',
230 #'django.contrib.sites', 234 #'django.contrib.sites',
231 #'django.contrib.messages', 235 #'django.contrib.messages',
232 'django.contrib.staticfiles', 236 'django.contrib.staticfiles',
@@ -243,6 +247,13 @@ INSTALLED_APPS = (
243 'bldcontrol', 247 'bldcontrol',
244) 248)
245 249
250# if we run in managed mode, we need user support
251if MANAGED:
252 INSTALLED_APPS = ('django.contrib.auth',
253 'django.contrib.contenttypes',
254 'django.contrib.sessions',) + INSTALLED_APPS
255
256
246# We automatically detect and install applications here if 257# We automatically detect and install applications here if
247# they have a 'models.py' or 'views.py' file 258# they have a 'models.py' or 'views.py' file
248import os 259import os