def get_loaders(): from django.template.loader import template_source_loaders if template_source_loaders is None: try: from django.template.loader import find_template as finder except ImportError: from django.template.loader import find_template_source as finder # noqa try: source, name = finder('test') except TemplateDoesNotExist: pass from django.template.loader import template_source_loaders return template_source_loaders or []
def get_loaders(): if VERSION[:2] < (1, 8): from django.template.loader import template_source_loaders if template_source_loaders is None: try: from django.template.loader import find_template as finder except ImportError: from django.template.loader import find_template_source as finder # noqa try: source, name = finder('test') except TemplateDoesNotExist: pass from django.template.loader import template_source_loaders return template_source_loaders or [] else: from django.template.loader import _engine_list loaders = [] for engine in _engine_list(): loaders.extend(engine.engine.template_loaders) return loaders