how to render django template variable as html?

前端 未结 4 689
温柔的废话
温柔的废话 2021-02-13 14:16

What I want is like stack overflow. User can HTML format their text input, and the page should be rendered exactly in the same way,

I use the wmd.js to stor

4条回答
  •  遥遥无期
    2021-02-13 15:00

    use tag : http://docs.djangoproject.com/en/dev/ref/templates/builtins/#autoescape

    {% autoescape off %}{{ variable }}{% endautoescape %} 
    

提交回复
热议问题