Skip to content

Latest commit

 

History

History
10 lines (7 loc) · 255 Bytes

read-jinja2-template-from-file.md

File metadata and controls

10 lines (7 loc) · 255 Bytes

How to open an jinja2 template from a file

from jinja2 import Environment, FileSystemLoader

environment = Environment(loader=FileSystemLoader("./"))
template = environment.get_template("template.j2")

print(template.render(<variables>))