return jinja2 template environment per docs

Use the alias 'jinja2' to look up the jinja2 template engine per https://docs.djangoproject.com/en/1.9/topics/templates/#django.template.loader.engines
This commit is contained in:
thenewguy
2016-01-18 23:23:24 -05:00
parent 88642c4585
commit 39e6ab973a

View File

@@ -73,13 +73,10 @@ class CompressorConf(AppConf):
# Returns the Jinja2 environment to use in offline compression.
def JINJA2_GET_ENVIRONMENT():
alias = 'Jinja2'
alias = 'jinja2'
try:
from django.template.loader import _engine_list
engines = _engine_list(alias)
if engines:
engine = engines[0]
return engine.env
from django.template import engines
return engines[alias].env
except InvalidTemplateEngineError:
raise InvalidTemplateEngineError(
"Could not find config for '{}' "