diff options
Diffstat (limited to 'bitbake/lib/toaster/toastermain/settings.py')
-rw-r--r-- | bitbake/lib/toaster/toastermain/settings.py | 70 |
1 files changed, 41 insertions, 29 deletions
diff --git a/bitbake/lib/toaster/toastermain/settings.py b/bitbake/lib/toaster/toastermain/settings.py index 1fd649c080..54ab31f302 100644 --- a/bitbake/lib/toaster/toastermain/settings.py +++ b/bitbake/lib/toaster/toastermain/settings.py @@ -24,7 +24,6 @@ import os DEBUG = True -TEMPLATE_DEBUG = DEBUG # Set to True to see the SQL queries in console SQL_DEBUG = False @@ -161,12 +160,47 @@ STATICFILES_FINDERS = ( # Make this unique, and don't share it with anybody. SECRET_KEY = 'NOT_SUITABLE_FOR_HOSTED_DEPLOYMENT' -# List of callables that know how to import templates from various sources. -TEMPLATE_LOADERS = ( - 'django.template.loaders.filesystem.Loader', - 'django.template.loaders.app_directories.Loader', -# 'django.template.loaders.eggs.Loader', -) +class InvalidString(str): + def __mod__(self, other): + from django.template.base import TemplateSyntaxError + raise TemplateSyntaxError( + "Undefined variable or unknown value for: \"%s\"" % other) + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [ + # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". + # Always use forward slashes, even on Windows. + # Don't forget to use absolute paths, not relative paths. + ], + 'OPTIONS': { + 'context_processors': [ + # Insert your TEMPLATE_CONTEXT_PROCESSORS here or use this + # list if you haven't customized them: + 'django.contrib.auth.context_processors.auth', + 'django.template.context_processors.debug', + 'django.template.context_processors.i18n', + 'django.template.context_processors.media', + 'django.template.context_processors.static', + 'django.template.context_processors.tz', + 'django.contrib.messages.context_processors.messages', + # Custom + 'django.core.context_processors.request', + 'toastergui.views.managedcontextprocessor', + + ], + 'loaders': [ + # List of callables that know how to import templates from various sources. + 'django.template.loaders.filesystem.Loader', + 'django.template.loaders.app_directories.Loader', + #'django.template.loaders.eggs.Loader', + ], + 'string_if_invalid': InvalidString("%s"), + 'debug': DEBUG, + }, + }, +] MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', @@ -203,22 +237,6 @@ ROOT_URLCONF = 'toastermain.urls' # Python dotted path to the WSGI application used by Django's runserver. WSGI_APPLICATION = 'toastermain.wsgi.application' -TEMPLATE_DIRS = ( - # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". - # Always use forward slashes, even on Windows. - # Don't forget to use absolute paths, not relative paths. -) - -TEMPLATE_CONTEXT_PROCESSORS = ('django.contrib.auth.context_processors.auth', - 'django.core.context_processors.debug', - 'django.core.context_processors.i18n', - 'django.core.context_processors.media', - 'django.core.context_processors.static', - 'django.core.context_processors.tz', - 'django.contrib.messages.context_processors.messages', - "django.core.context_processors.request", - 'toastergui.views.managedcontextprocessor', - ) INSTALLED_APPS = ( 'django.contrib.auth', @@ -348,10 +366,4 @@ connection_created.connect(activate_synchronous_off) # -class InvalidString(str): - def __mod__(self, other): - from django.template.base import TemplateSyntaxError - raise TemplateSyntaxError( - "Undefined variable or unknown value for: \"%s\"" % other) -TEMPLATE_STRING_IF_INVALID = InvalidString("%s") |