This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

HTML compressor for django

Why compress HTML code?

When compressed HTML code, you reduce the size of data transferred from your server to your client, and your pages load faster.


For install django-compresshtml, run on terminal: ::

$ [sudo] pip install django-compresshtml

Using the midleware

All you need to do is add ``compresshtml.middleware.CompressHtmlMiddleware`` to your ``MIDDLEWARE_CLASSES`` and enable the ``COMPRESS_HTML`` setting:

# other middleware classes


This middleware should be placed before any other middleware that need to read or write the response body so that compression happens afterward.

The default value for the ``COMPRESS_HTML`` setting is ``not DEBUG``. You only need to set it to ``True`` if you want to minify your HTML code when ``DEBUG`` is enabled.

Keeping comments

The default behaviour of the middleware is remove all comments but conditional comments from HTML. If you want to keep your comments, set the setting ``KEEP_COMMENTS_ON_COMPRESSING`` to ``True``:


Using the decorator

django-compresshtml also provides a decorator, that you can use only on views you want to minify the response:

from compresshtml.decorators import compressed_response

def home(request):
return render_to_response('home.html')


* Source hosted at `GitHub <>`
* Report issues on `GitHub Issues <>`

Pull requests are very welcomed!



* Initial commit


Unless otherwise noted, the django-compresshtml source files are distributed under the BSD-style license found in the LICENSE file.
Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-compresshtml-0.1.1.tar.gz (2.7 kB) Copy SHA256 Checksum SHA256 Source Oct 29, 2012

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting