In my mainline I want to read a variable from the current template context, after the template was rendered.
This variable has been “set” bij the template. I can access the variable in a context function, but how to access it in my mainline.
result = template.render({'a' : "value-1" })
# in the template {% set b = "value-2" %}
b = ?
Update : I found a solution in the webapp2 source. The line is :
b = template.module.b
I found out, with the help of the webapp2-extras source, that accessing the current jinja context is possible in the python mainline. See also : class jinja2.Template in the jinja documentation.
Python mainline :
Thanks for your help.