fastapi_tools.templating
¶
Jinja2 template engine configuration.
Functions:
-
configure_templates–Inject application-wide globals into the Jinja2 environment.
-
make_templates–Create a Jinja2Templates instance for the given directory.
configure_templates
¶
Inject application-wide globals into the Jinja2 environment.
Parameters:
-
templates(Jinja2Templates) –Jinja2Templates instance to configure.
-
config(WebappConfig) –Webapp configuration containing app metadata.
Source code in src/fastapi_tools/templating.py
make_templates
¶
Create a Jinja2Templates instance for the given directory.
Parameters:
Returns:
-
Jinja2Templates–Configured Jinja2Templates instance.