I've got a Django filter that's not doing the right thing. I'm expecting to see actual html in the output, but what I see are html escaped brackets. I've tried autoescape off, and I've tried |safe, and I've tried both at the same time. No joy. Wtf?
<td>{% autoescape off %}{{ notif.output|safe|insert_break开发者_开发问答s|linkify }}{% endautoescape %}</td>
I'm not seeing any errors, just autoescaped text that really shouldn't be escaped.
the answer to this is:
Make sure your template_dir in settings.py is pointing to the correct instance, when running multiple versions of your code on one host.
Ah, I just read the docs again. The answer is that having any filters after your safe
makes the string unsafe again. So either put safe
at the end, or put it at the end again.
精彩评论