【问题标题】:Stripping server side comments in Python在 Python 中剥离服务器端注释
【发布时间】:2011-04-02 14:33:16
【问题描述】:

在 JSP 中:

<%-- Comments removed in server --%>

当我在 Python/Django 中运行时,什么是等效的?!?

我不希望 HTML cmets 在客户端可见...

【问题讨论】:

    标签: python html django comments


    【解决方案1】:
    {% comment %}
    
    add your comment here :-)
    
    {% endcomment %}
    

    【讨论】:

      【解决方案2】:

      您可以使用Django模板注释块http://docs.djangoproject.com/en/dev/ref/templates/builtins/#comment

      它们不会显示在客户端,但您会在编辑模板时看到它。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2015-03-12
        • 2015-10-28
        • 1970-01-01
        • 1970-01-01
        • 2019-10-07
        • 1970-01-01
        • 2010-12-29
        相关资源
        最近更新 更多