djblets.extensions.loaders¶
Template loaders for extensions.
- class ExtensionOrigin(package, resource, *args, **kwargs)[source]¶
An origin for a template in an extension.
New in version 3.0.
- class Loader(engine)[source]¶
Loads templates found within an extension.
This will look through all enabled extensions and attempt to fetch the named template under the
templates
directory within the extension’s package.This should be added last to the list of template loaders.
New in version 0.9.
- get_contents(origin)[source]¶
Return the contents of a template.
- Parameters
origin (ExtensionOrigin) – The origin of the template.
- Returns
The resulting template contents.
- Return type
unicode
- Raises
TemplateDoesNotExist – The template could not be found.