Created
August 22, 2017 12:59
-
-
Save sprytnyk/debb7075418966f5886a7a292f6e5b08 to your computer and use it in GitHub Desktop.
Render template without flask context
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def render_without_context(template_name, **context): | |
env = jinja2.Environment( | |
loader=jinja2.PackageLoader('ui') | |
) | |
template = env.get_template(template_name) | |
return template.render(**context) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment