module documentation
API and implementations for loading templates from different data sources.
Class |
|
Baseclass for all loaders. Subclass this and override `get_source` to implement a custom loading mechanism. The environment provides a `get_template` method that calls the loader's `load` method to get the :class:`Template` object. |
Class |
|
This loader works like the `PrefixLoader` just that no prefix is specified. If a template could not be found by one loader the next one is tried. |
Class |
|
Loads a template from a Python dict mapping template names to template source. This loader is useful for unittesting: |
Class |
|
Load templates from a directory in the file system. |
Class |
|
A loader that is passed a function which does the loading. The function receives the name of the template and has to return either a string with the template source, a tuple in the form ``(source, filename, uptodatefunc)`` or `None` if the template does not exist. |
Class |
|
This loader loads templates from precompiled templates. |
Class |
|
Load templates from a directory in a Python package. |
Class |
|
A loader that is passed a dict of loaders where each loader is bound to a prefix. The prefix is delimited from the template by a slash per default, which can be changed by setting the `delimiter` argument to something else::... |
Function | split |
Split a path into segments and perform a sanity check. If it detects '..' in the path it will raise a `TemplateNotFound` error. |
Class | _ |
Like a normal module but with support for weak references |