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 templateContext(request):
def AppVersionContext(request):
result = {} result = {}
if 'APP_VERSION' in environ: if hasattr(settings, 'TEMPLATE_CONTEXT'):
result = { for item in settings.TEMPLATE_CONTEXT:
'app_version': environ['APP_VERSION'] result[item[0]] = item[1]
}
return result return result

View File

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