django-slimmer icondjango-slimmer 0.0.2

HTML compression as middleware and view decorators
django-slimmer is a Django conversion of CheckoutableTemplates Zope package: http://zope.org/Members/peterbe/CheckoutableTemplates

The 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-slimmer

Install middleware

'slimmer.middleware.CompressHtmlMiddleware',

Or you can use a view decorator to compress specific views

from slimmer.decorator import compress_html

@compress_html
def browse(request):
 context = RequestContext(request,{})
 return render_to_response('browse.html',context)


Using the slimmer directly

from slimmer import slimmer
compressed = slimmer.xhtml_slimmer(html)

last updated on:
February 13th, 2010, 21:49 GMT
price:
FREE!
developed by:
Harley Bussell
license type:
MIT/X Consortium License 
category:
ROOT \ Internet \ HTTP (WWW)

FREE!

In a hurry? Add it to your Download Basket!

user rating

UNRATED
0.0/5
 

0/5

Add your review!

SUBMIT