Skip to content

Commit

Permalink
return jinja2 template environment per docs
Browse files Browse the repository at this point in the history
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
  • Loading branch information
thenewguy committed Jan 19, 2016
1 parent 88642c4 commit 39e6ab9
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions compressor/conf.py
Expand Up @@ -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 '{}' "
Expand Down

0 comments on commit 39e6ab9

Please sign in to comment.