template.loaders.base.Loader.get_template()

get_template(template_name, skip=None) [source]

Returns a Template object for a given template_name by looping through results from get_template_sources() and calling get_contents(). This returns the first matching template. If no template is found, TemplateDoesNotExist is raised.

The optional skip argument is a list of origins to ignore when extending templates. This allow templates to extend other templates of the same name. It also used to avoid recursion errors.

In general, it is enough to define get_template_sources() and get_contents() for custom template loaders. get_template() will usually not need to be overridden.

doc_Django
2016-10-09 18:39:50
Comments
Leave a Comment

Please login to continue.