Skip to content Skip to sidebar Skip to footer

Including HTML Variable In Django Template Without Escaping

I have html encoded text which reads like this: RT @freuter... I want this displayed as html but I am not sure if there is a

Solution 1:

As Daniel says, use the {{ tweet|safe }} filter in the html, or mark it safe from the views.

Use django.template.mark_safe()


Solution 2:

Try the |safe filter if you want to render all HTML.


Solution 3:

See: How do I perform HTML decoding/encoding using Python/Django?

I think this answers your querstion.


Post a Comment for "Including HTML Variable In Django Template Without Escaping"