django-slimmer

HTML compression as middleware and view decorators
Download

django-slimmer Ranking & Summary

Advertisement

  • Rating:
  • License:
  • MIT/X Consortium Lic...
  • Price:
  • FREE
  • Publisher Name:
  • Harley Bussell
  • Publisher web site:
  • http://github.com/hbussell/

django-slimmer Tags


django-slimmer Description

HTML compression as middleware and view decorators django-slimmer is a Django conversion of CheckoutableTemplates Zope package: http://zope.org/Members/peterbe/CheckoutableTemplatesThe slimmer is taken directly from the Zope package, with django middleware and a view decorator added.The slimming process takes html and removes whitespace, optimizes inline css, removes oneline comments. The end result can be a significant file size reduction even after the page is served with gzip compression.Installation:sudo easy_install django-slimmerInstall middleware'slimmer.middleware.CompressHtmlMiddleware',Or you can use a view decorator to compress specific viewsfrom slimmer.decorator import compress_html@compress_htmldef browse(request): context = RequestContext(request,{}) return render_to_response('browse.html',context)Using the slimmer directlyfrom slimmer import slimmercompressed = slimmer.xhtml_slimmer(html) Requirements: · Python · Django


django-slimmer Related Software