Derek
Derek

Reputation: 12378

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 %}{% endif %} , but that's an error.

Thanks!

Upvotes: 0

Views: 387

Answers (1)

Brandon Taylor
Brandon Taylor

Reputation: 34553

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

Upvotes: 3

Related Questions