开发者

Using conditions with django template tags/filters?

开发者 https://www.devze.com 2023-03-20 00:30 出处:网络
If I\'m using {% spaceless %}<html></html>{% endspaceless %} in my templates, but I only want the spaceless function on only when I\'m not debugging, how can do this?I tried using {% if %}

If I'm using {% spaceless %}<html></html>{% endspaceless %} in my templates, but I only want the spaceless function on only when I'm not debugging, how can do this? I tried using {% if %}{% spaceless %}{%开发者_如何学C endif %} , but that's an error.

Thanks!


I wrote just such a tag and put it on Django Snippets: http://djangosnippets.org/snippets/2405/ Enjoy!

0

精彩评论

暂无评论...
验证码 换一张
取 消