The jinja API document at pocoo.org states:
The simplest way to configure Jinja2 to load templates for your application looks roughly like this:
A simpler way is to directly call the jinj2.Template constructor and use open to load the file:
open
from jinja2 import Template with open('template.html.jinja2') as file_: template = Template(file_.read()) template.render(name='John')