I’m using django to make an online testing system, and I want to render a piece of text from database into the page. The text may have variety numbers of tag. When the page is rendered, it strips out the tag and display like this
< img src="{{STATIC_URL}}img/2003/p1q71.jpg" >
instead of displaying image. Any solution for this?
I’m using django to make an online testing system, and I want to render
Share
Read about the built-in
safefilter.Django does not consider data from the database to the “Safe”.
It always “escapes” any tag-like content in database data to prevent HTML Script Injection attacks.