Let's say that I have this string:
s = '<p>Hello!</p>'
When I pass this variable to a template, I want it to be rendered as raw html. Looking at the docs I see that I can either use the safe filter:
{{s|safe}}
or disable autoescape:
{%autoescape off}
{{s}}
{%endautoescape%}
or inside the python code declare it safe:
from django.utils.safestring import mark_safe
s = mark_safe(s)
None of these options are working for me. Whatever I do, the string is displayed as:
<p>Hello!</p>
I must be missing something, just couldn't figure out what. Is there some security setting somewhere that disallows escaping?
EDIT: Bizarre, the problem seems to be gone after I have restarted the computer.