Skip to content

Instantly share code, notes, and snippets.

@britonad
Created August 22, 2017 12:59
Show Gist options
  • Save britonad/debb7075418966f5886a7a292f6e5b08 to your computer and use it in GitHub Desktop.
Save britonad/debb7075418966f5886a7a292f6e5b08 to your computer and use it in GitHub Desktop.
Render template without flask context
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