[Flask] Passing dict instead of Context in render_template

Xan xancorreu at gmail.com
Wed Feb 3 05:53:13 EST 2016


Hi,

I just want to know if I can do something like render_template(template, {'foo': 2, 'baa': 3}) instead of render_template(template, foo=2, baa=3). I want to pass a variable list of assignment. So I think that dict is the only solution.

If I have:

a = {'foo': 2, 'baa': 3, ...}

How can I do, render_template(template, a)? (a has variable value)


Thanks a lot,
Xan

PS: I asked in stackoverflow with a missunderstanding http://stackoverflow.com/questions/35117821/pass-a-list-of-assignments-in-a-template-in-a-flask


More information about the Flask mailing list