From 39e6ab973a0b8dbbd0447a610d39c6293367d1bf Mon Sep 17 00:00:00 2001 From: thenewguy Date: Mon, 18 Jan 2016 23:23:24 -0500 Subject: [PATCH] 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 --- compressor/conf.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/compressor/conf.py b/compressor/conf.py index c9dd953..5338257 100644 --- a/compressor/conf.py +++ b/compressor/conf.py @@ -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 '{}' "