Easy Way to Escape Django Template Variables

后端 未结 6 911
礼貌的吻别
礼貌的吻别 2021-02-04 06:28

For a new project we\'re writing documentation about the Django template system. We use Django for the documentation project itself too, so Django picks up all our exam

6条回答
  •  一个人的身影
    2021-02-04 06:38

    Django 1.5 solves this problem with the verbatim template tag. It also works fine with the current Django versions.

    {% verbatim myblock %}
        Avoid template rendering via the {% verbatim %}{% endverbatim %} block.
    {% endverbatim myblock %}
    

提交回复
热议问题