django - Cleaning up HTML templates for production
-
06-06-2021 - |
Pergunta
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?
Solução
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 :)
Outras dicas
HTML::Clean might do it.
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow