class EngineHandler

from django.template.utils import EngineHandler


  

Ancestors (MRO)

  1. builtins.object
  2. django.template.utils.EngineHandler
AttributeTypeDefined in
def __getitem__(self, alias)
django.template.utils.EngineHandler
    def __getitem__(self, alias):
        try:
            return self._engines[alias]
        except KeyError:
            try:
                params = self.templates[alias]
            except KeyError:
                raise InvalidTemplateEngineError(
                    "Could not find config for '{}' "
                    "in settings.TEMPLATES".format(alias)
                )

            # If importing or initializing the backend raises an exception,
            # self._engines[alias] isn't set and this code may get executed
            # again, so we must preserve the original params. See #24265.
            params = params.copy()
            backend = params.pop("BACKEND")
            engine_cls = import_string(backend)
            engine = engine_cls(params)

            self._engines[alias] = engine
            return engine
def __init__(self, templates=None)
django.template.utils.EngineHandler
templates is an optional list of template engine definitions
(structured like settings.TEMPLATES).
    def __init__(self, templates=None):
        """
        templates is an optional list of template engine definitions
        (structured like settings.TEMPLATES).
        """
        self._templates = templates
        self._engines = {}
def __iter__(self)
django.template.utils.EngineHandler
    def __iter__(self):
        return iter(self.templates)
def all(self)
django.template.utils.EngineHandler
    def all(self):
        return [self[alias] for alias in self]
def templates(self)
django.template.utils.EngineHandler