class documentation

class Engine:

View In Hierarchy

Undocumented

Static Method get​_default Return the first DjangoTemplates backend that's configured, or raise ImproperlyConfigured if none are configured.
Method from​_string Return a compiled Template object for the given template code, handling template inheritance recursively.
Method get​_template Return a compiled Template object for the given template name, handling template inheritance recursively.
Method select​_template Given a list of template names, return the first that can be loaded.
Method __init__ Undocumented
Method __repr__ Undocumented
Method find​_template Undocumented
Method find​_template​_loader Undocumented
Method get​_template​_builtins Undocumented
Method get​_template​_libraries Undocumented
Method get​_template​_loaders Undocumented
Method render​_to​_string Render the template specified by template_name with the given context. For use in Django's test suite.
Class Variable default​_builtins Undocumented
Instance Variable app​_dirs Undocumented
Instance Variable autoescape Undocumented
Instance Variable builtins Undocumented
Instance Variable context​_processors Undocumented
Instance Variable debug Undocumented
Instance Variable dirs Undocumented
Instance Variable file​_charset Undocumented
Instance Variable libraries Undocumented
Instance Variable loaders Undocumented
Instance Variable string​_if​_invalid Undocumented
Instance Variable template​_builtins Undocumented
Instance Variable template​_libraries Undocumented
Property template​_context​_processors Undocumented
Property template​_loaders Undocumented
@staticmethod
@functools.lru_cache()
def get_default():

Return the first DjangoTemplates backend that's configured, or raise ImproperlyConfigured if none are configured.

This is required for preserving historical APIs that rely on a globally available, implicitly configured engine such as:

>>> from django.template import Context, Template
>>> template = Template("Hello {{ name }}!")
>>> context = Context({'name': "world"})
>>> template.render(context)
'Hello world!'
def from_string(self, template_code):
Return a compiled Template object for the given template code, handling template inheritance recursively.
def get_template(self, template_name):
Return a compiled Template object for the given template name, handling template inheritance recursively.
def select_template(self, template_name_list):
Given a list of template names, return the first that can be loaded.
def __init__(self, dirs=None, app_dirs=False, context_processors=None, debug=False, loaders=None, string_if_invalid='', file_charset='utf-8', libraries=None, builtins=None, autoescape=True):

Undocumented

def __repr__(self):

Undocumented

def find_template(self, name, dirs=None, skip=None):

Undocumented

def find_template_loader(self, loader):

Undocumented

def get_template_builtins(self, builtins):

Undocumented

def get_template_libraries(self, libraries):

Undocumented

def get_template_loaders(self, template_loaders):

Undocumented

def render_to_string(self, template_name, context=None):
Render the template specified by template_name with the given context. For use in Django's test suite.
default_builtins: list[str] =

Undocumented

app_dirs =

Undocumented

autoescape =

Undocumented

builtins =

Undocumented

context_processors =

Undocumented

debug =

Undocumented

dirs =

Undocumented

file_charset =

Undocumented

libraries =

Undocumented

loaders =

Undocumented

string_if_invalid =

Undocumented

template_builtins =

Undocumented

template_libraries =

Undocumented

@cached_property
template_context_processors =

Undocumented

@cached_property
template_loaders =

Undocumented