Search code examples
htmldjangodjango-templateshttp-compression

django - Cleaning up HTML templates for production


Is there a tool for django that would allow me to "prep" the static HTML templates for production?

My templates are growing heavy in comments and shelved code that is useful to have when in development, but when deployed these extra comments will be an unnecessary hit on performance (and I don't want to announce them to the word).

Is there a plugin for django that would prune the HTML?


Solution

  • Here is a snippet for runtime processing: http://djangosnippets.org/snippets/123/ If it delays your page rendering and it is not acceptable you should write a script to iterate over templates and apply it after deployment :)