将字符串转换为 django 模板中的 html 代码 [英] convert string to html code in django template

查看:28
本文介绍了将字符串转换为 django 模板中的 html 代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能的重复:
django:将模板变量渲染为 html

我正在开发一个 django 站点,我有一个字符串变量,其中包含 html 标签.我需要将该字符串作为模板上的 html 代码读取.

I am developing a django site and I have a string variable which has html tags in it. I need that string to be read as html code on my template.

例如,如果我有一个字符串变量

For instance if I have a string variable

description = "

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆