禁用django中的块

时间:2009-06-12 06:10:30

标签: python django google-app-engine

我想在开发中禁用一个块,并在python开发中的谷歌应用程序中部署它。我需要在模板或主脚本中进行哪些更改?

1 个答案:

答案 0 :(得分:3)

如果您有中间件django.core.content_processors.debug,那么您可以在模板中执行此操作:

{% block mydebugonly %}
    {% if debug %}
    <p>Something that will only appear if the DEBUG setting is True.</p>
    {% endif %}
{% endblock %}