Instead of passing variables to the template as follows:
template.render(var1='hello', var2='world')
How to pass a dictionary to a template and make it the same way
vars = {'var1': 'hello', 'var2': 'world'}
so in the template I can display the variables as usual:
${var1} ${var2}
I don't need extra code in the template, so I thought about using the Context object somehow, but I hit a brick wall. Any ideas?
Adam pointer
source share