@app.route('/test')
def test_view():
    t = app.jinja_env.get_template('macros.html')
mod = t.make_module({'request': request})
return mod.my_macro()
How to render a Jinja2 macro from a view callable?