Replaced appVersionContext with templateContext with get variables from settings.TEMPLATE_CONTEXT as tuples of key, value
This commit is contained in:
parent
b84551f78b
commit
e92e43bd32
|
@ -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
|
||||||
|
|
|
@ -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'
|
||||||
|
|
Loading…
Reference in New Issue