Disable HTML escaping in Django's TextField

后端 未结 3 1686
日久生厌
日久生厌 2020-12-05 02:17

How can I turn off Django\'s automatic HTML escaping, when I write into model\'s TextField?

3条回答
  •  感动是毒
    2020-12-05 03:11

    Just use django's safe filter. In your template you would do something like this:

    {{ instance.my_text_field|safe }}
    

提交回复
热议问题