簡體   English   中英

使用帶有 django 模板標簽/過濾器的條件?

[英]Using conditions with django template tags/filters?

如果我在我的模板中使用{% spaceless %}<html></html>{% endspaceless %} ,但我只希望在我不調試時才使用 spaceless function,怎么做? 我嘗試使用{% if %}{% spaceless %}{% endif %} ,但這是一個錯誤。

謝謝!

我只寫了這樣一個標簽並將其放在 Django 片段: http://djangosnippets.org/snippets/2405/享受!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM