01_template_from_string 

Send to Kindle
home » snippets » python » jinja2 » example » 01_template_from_string



Template from string.

# -*- coding: UTF-8 -*-

from jinja2 import Template
template = Template('Hello {{ name }}!')
template.render(name='John Doe')