How can I disable autoescape in django feeds?

I am using django framework to organize rss feeds for my website. I need to put some hyperlinks to feed the items, but all of them are autoescaped ("<" is replaced with "& lt;", etc.). Is it possible to save tags in my feed (as I understand it, I cannot use {% autoescape off%} in feed templates)? Thank.

+2


source to share


2 answers


Please read Auto Escaping HTML in Django and try the following syntax. Where data is the variable that contains your link



{{ data|safe }}

      

+5


source


As mentioned in shake, you can use a "safe" filter, but it's annoying if you want to turn off auto-protection frequently. Django also supports {% autoescape off%} {% autoescape end%} blocks, everything inside the block will not autoplay.



EDITED: Sorry, I didn't fully read your question in title only :). Why can't you use the autoescape tag in your feeds? There are no restrictions.

0


source







All Articles