Jinja 2 safe keyword

前端 未结 3 1208
故里飘歌
故里飘歌 2021-02-04 01:28

I have a little problem understanding what an expression like {{ something.render() | safe }} does .

From what I have seen, without the safe ke

3条回答
  •  别跟我提以往
    2021-02-04 01:54

    For anyone coming here looking to use the safe filter programmatically: wrap it in a markupsafe.Markup class, on which Jinja2 depends on.

提交回复
热议问题