I want to make my GAE application webapp2 compatible. This code worked great with webapp:
insert = '<p><font color="red"><b>some text</b></font></p>'
template_values = {
'insert': insert,
...
}
path = ...
self.response.out.write(template.render(path,template_values))
The content of the variable insert was just put into the web page output by webapp. Now the content of the variable is "analyzed" by webapp2 and the content is changed when it is inserted in the webpage.
webapp2 inserts this:
<p><font color="red"><b>some text</b></font></p>
How can I go back to the old behavior?
Thanks for any help.
Have a look at
safe
: https://docs.djangoproject.com/en/dev/ref/templates/builtins/#safe &
autoescape
: https://docs.djangoproject.com/en/dev/ref/templates/builtins/#autoescape.
Eg:
{{ insertHTML|safe }}
OR
{% autoescape off %}{{ inserHTML }}{% endautoescape %}