Skip to main content

get_template

Load and return a template for the given name.

Raise TemplateDoesNotExist if no such template exists.

def get_template(
template_name: string,
using: string = None
) - > Template

Load and return a template for the given name.

Parameters

NameTypeDescription
template_namestringThe path or identifier of the template file to be loaded.
usingstring = NoneThe name of a specific template engine to use for loading; if None, all configured engines are searched in order.

Returns

TypeDescription
TemplateA template object compatible with the engine that loaded it, used for rendering content.