mako#
- class starlite.contrib.mako.MakoTemplate#
Bases:
TemplateProtocolMako template, implementing
TemplateProtocol
- class starlite.contrib.mako.MakoTemplateEngine#
Bases:
TemplateEngineProtocol[MakoTemplate]Mako based TemplateEngine.
- __init__(directory: Union[DirectoryPath, List[DirectoryPath]]) None#
Initialize template engine.
- Parameters:
directory – Direct path or list of directory paths from which to serve templates.
- get_template(template_name: str) MakoTemplate#
Retrieve a template by matching its name (dotted path) with files in the directory or directories provided. :param template_name: A dotted path
- Returns:
MakoTemplate instance
- Raises:
TemplateNotFoundException <starlite.exceptions.TemplateNotFoundException> – if no template is found.