0

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?

Goro
  • 9,919
  • 22
  • 74
  • 108

2 Answers2

1

HTML::Clean might do it.

Robert Harvey
  • 178,213
  • 47
  • 333
  • 501
  • Ah, but that's in Perl, on which I gave up long ago. I was wondering if there was something pecific for django? – Goro May 08 '12 at 22:26
  • Well, I was thinking about just using this as a utility. How many pages are we talking about, and how many times will you have to clean them? For every deployment? – Robert Harvey May 08 '12 at 22:31
1

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 :)

dbf
  • 6,399
  • 2
  • 38
  • 65
  • I was hoping someone rolled this into a rake already. I guess I get to write my own :) – Goro May 14 '12 at 20:57