Replaced appVersionContext with templateContext with get variables from settings.TEMPLATE_CONTEXT as tuples of key, value

This commit is contained in:
Felipe Martín 2013-05-24 12:19:39 +02:00
parent b84551f78b
commit e92e43bd32
2 changed files with 6 additions and 9 deletions

View File

@ -1,11 +1,8 @@
from os import environ
from django.conf import settings
def AppVersionContext(request):
def templateContext(request):
result = {}
if 'APP_VERSION' in environ:
result = {
'app_version': environ['APP_VERSION']
}
if hasattr(settings, 'TEMPLATE_CONTEXT'):
for item in settings.TEMPLATE_CONTEXT:
result[item[0]] = item[1]
return result

View File

@ -94,7 +94,7 @@ TEMPLATE_LOADERS = (
)
TEMPLATE_CONTEXT_PROCESSORS = global_settings.TEMPLATE_CONTEXT_PROCESSORS + (
'herobrine.context.AppVersionContext',
'herobrine.context.templateContext',
)
JINGO_INCLUDE_PATTERN = r'\.html'