How to escape {{ or }} in django template?

前端 未结 10 1928
慢半拍i
慢半拍i 2020-12-01 04:17

Django treats {{ var }} as some variable in its template. How can I escape {{ var }} or {{ or }} such that django does no

10条回答
  •  忘掉有多难
    2020-12-01 04:46

    Another option would be to add a word joiner (zero width no-break space) between each curly bracket:

    "{⁠{ some text }⁠}"

提交回复
热议问题