jinja2.DictLoader

class jinja2.DictLoader(mapping)[source]

Loads a template from a python dict. It’s passed a dict of unicode strings bound to template names. This loader is useful for unittesting:

>>> loader = DictLoader({'index.html': 'source here'})

Because auto reloading is rarely useful this is disabled per default.

Methods

__init__(mapping)
get_source(environment, template)
list_templates()
load(environment, name[, globals]) Loads a template.

Attributes

has_source_access