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!
精彩评论