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 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
|
||||
|
|
|
@ -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'
|
||||
|
|
Loading…
Reference in New Issue