Skip to main content

TemplatesSetting

Load templates using template.loader.get_template() which is configured based on settings.TEMPLATES.

Methods


get_template()

@classmethod
def get_template(
template_name: string
) - > django.template.Template

Load templates using template.loader.get_template() which is configured based on settings.TEMPLATES.

Parameters

NameTypeDescription
template_namestringThe path or identifier of the template file to be loaded from the configured template directories

Returns

TypeDescription
django.template.TemplateA compiled template object that can be rendered with a context