Hi! I use django feed framework to organize rss feeds for my website. I need to put some hyperlinks to feed items, but al of them are autoescaped ( "<" is replaced with "<" and so on). Is it possible to keep tags in my feed (as I understand, I can't use {% autoescape off %} tag in feed templates)? Thanks.
+3
A:
Read up on Automatic HTML escaping in Django and try the following syntax. Where data is the variable which holds your link
{{ data|safe }}
jitter
2009-10-20 08:00:46
A:
As jitter mentioned you can use "safe" filter, but it's annoying if you want to disable autoescaping often. Django also supports {% autoescape off %} {% autoescape end %} blocks, everything inside is block won't be autoescaped.
EDITED: Sorry, I haven't read your question completely only title :). Why you can't use autoescape tag in feeds? There's no restriction about it.
giolekva
2009-10-20 08:04:08
giolekva, I've tried it and there is atill autoescaping. I have an idea, that, probably, not all tags are allowed in feed templates.
dbf
2009-10-20 12:38:44
There's no difference between templates, they can generate any format: HTML, XML, JSON and so on. I think you have different problem. Can you post error Django generates?
giolekva
2009-10-20 14:40:09