Add comments in compress command code regarding how template loaders are instanciated

This commit is contained in:
Mathieu Pillard
2011-12-05 19:12:19 +01:00
parent b7583b0d2b
commit f527f7628b

View File

@@ -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