Created
July 31, 2014 14:34
-
-
Save qgerome/56bc01a42aaa5c5cbd7f to your computer and use it in GitHub Desktop.
Flask : how to render only a macro from template (jinja2)
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
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