From f527f7628b8191643b567f3de93c6024a19f5f9c Mon Sep 17 00:00:00 2001 From: Mathieu Pillard Date: Mon, 5 Dec 2011 19:12:19 +0100 Subject: [PATCH] Add comments in compress command code regarding how template loaders are instanciated --- compressor/management/commands/compress.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/compressor/management/commands/compress.py b/compressor/management/commands/compress.py index 305bbe8..05a451a 100644 --- a/compressor/management/commands/compress.py +++ b/compressor/management/commands/compress.py @@ -66,9 +66,14 @@ class Command(NoArgsCommand): from django.template.loader import ( find_template_source as finder_func) try: + # Force django to calculate template_source_loaders from + # TEMPLATE_LOADERS settings, by asking to find a dummy template source, name = finder_func('test') except TemplateDoesNotExist: pass + # Reload template_source_loaders now that it has been calculated ; + # it should contain the list of valid, instanciated template loaders + # to use. from django.template.loader import template_source_loaders loaders = [] # If template loader is CachedTemplateLoader, return the loaders