Coverage for kwai/core/template/dependency.py: 0%
6 statements
« prev ^ index » next coverage.py v7.3.0, created at 2023-09-05 17:55 +0000
« prev ^ index » next coverage.py v7.3.0, created at 2023-09-05 17:55 +0000
1"""Module that defines a dependency for a template engine."""
2from fastapi import Depends
4from kwai.core.settings import get_settings
5from kwai.core.template.jinja2_engine import Jinja2Engine
6from kwai.core.template.template_engine import TemplateEngine
9def get_template_engine(settings=Depends(get_settings)) -> TemplateEngine:
10 """Get the template engine."""
11 return Jinja2Engine(settings.template_path, website=settings.website.dict())