Skip to main content
Help the Python Software Foundation raise $60,000 USD by December 31st!  Building the PSF Q4 Fundraiser

html minify middleware for django

Project description


Django HTML minification middleware (another one, a little bit faster than django-htmlmin)


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

$ pip install django-hmin

Using the midleware

All you need to do is add two middlewares to your ``MIDDLEWARE_CLASSES`` and
enable the ``HTML_MINIFY`` setting: ::

# other middleware classes

Note that if you're using Django's caching middleware, ``MarkMiddleware``
should go after ``FetchFromCacheMiddleware``, and ``MinMiddleware``
should go after ``UpdateCacheMiddleware``: ::

# other middleware classes

You can optionally specify the ``HTML_MINIFY`` setting::


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

Who cares? Use it whatever you want.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-hmin, version 0.1
Filename, size File type Python version Upload date Hashes
Filename, size django-hmin-0.1.tar.gz (2.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page