Sometime, you use variable {{content}} in the template page.
you may find that html tags in {{content}} (e.g.," <em> ABC </em>" ) are still shown in Web page. Html tags are not parsed.
The solution is to use "safe" filter in Django template.
change {{content}} to {{ content | safe}}
reference:
https://code.djangoproject.com/wiki/AutoEscaping
you may find that html tags in {{content}} (e.g.," <em> ABC </em>" ) are still shown in Web page. Html tags are not parsed.
The solution is to use "safe" filter in Django template.
change {{content}} to {{ content | safe}}
reference:
https://code.djangoproject.com/wiki/AutoEscaping
Comments
Post a Comment