Skip to content

Instantly share code, notes, and snippets.

@qgerome
Created July 31, 2014 14:34
Show Gist options
  • Save qgerome/56bc01a42aaa5c5cbd7f to your computer and use it in GitHub Desktop.
Save qgerome/56bc01a42aaa5c5cbd7f to your computer and use it in GitHub Desktop.
Flask : how to render only a macro from template (jinja2)
from flask import get_template_attribute
def render_template_macro(template_name_or_list, macro_name, **context):
return get_template_attribute(template_name_or_list, macro_name)(*context)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment