开发者

Using conditions with django template tags/filters?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜