I using Jinja2 with webapp2.
Jinja2 encodes all \'context\' data into unicode as their doc says. This is proving problematic when I try to insert a json string into
You must filter the value through the safe
filter to tell jinja2 that it shouldn't apply any other filters to the output. In jinja2 syntax this would be:
{{ jsonData | safe }}
Note that since you are calling json.loads
you actually do not have json data anymore, you have a python list object. Thus when it is serialized it's the same as calling unicode(['dogs', 'cats'])
which is going to give you your u
prefix. You might not want to actually parse the json data, or you'll need to turn the list into a string manually instead of having jinja2 do it for you.