我想在开发中禁用一个块,并在python开发中的谷歌应用程序中部署它。我需要在模板或主脚本中进行哪些更改?
答案 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 %}