Jump to >


class Loader(*args, **kwargs)[source]

Bases: django.template.loaders.app_directories.Loader

Looks for templates in app directories, optionally with a namespace.

This extends the standard Django ‘app_directories’ template loader by allowing a prefix specifying the app whose template should be used. It solves the problem of one app defining a template and another app trying to both override and extend it, resulting in an infinite loop.

Templates can be in the standard form of ‘path/to/template’, or in the namespaced form of ‘app.path:path/to/template’.

__init__(*args, **kwargs)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

get_template_sources(template_name, template_dirs=None)[source]

Return an Origin object pointing to an absolute path in each directory in template_dirs. For security reasons, if a path doesn’t lie inside one of the template_dirs it is excluded from the result set.