Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install django-compressor

How to install django_compressor

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install django-compressor
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
1.3 Available View build log
1.2 Available View build log
1.1.2 Available View build log
1.1.1 Available View build log
1.1 Available View build log
1.0.1 Available View build log
0.9.2 Available View build log
0.9.1 Available View build log
0.9 Available View build log
0.8 Available View build log
0.7.1 Available View build log
0.7 Available View build log
0.6.4 Available View build log
0.6.2 Available View build log
0.6.1 Available View build log
0.6 Available View build log
0.5.3 Available View build log
Windows (64-bit)
1.3 Available View build log
1.2 Available View build log
1.1.2 Available View build log
1.1.1 Available View build log
1.1 Available View build log
1.0.1 Available View build log
0.9.2 Available View build log
0.9.1 Available View build log
0.9 Available View build log
0.8 Available View build log
0.7.1 Available View build log
0.7 Available View build log
0.6.4 Available View build log
0.6.2 Available View build log
0.6.1 Available View build log
0.6 Available View build log
0.5.3 Available View build log
Mac OS X (10.5+)
1.3 Available View build log
1.2 Available View build log
1.1.2 Available View build log
1.1.1 Available View build log
1.1 Available View build log
1.0.1 Available View build log
0.9.2 Available View build log
0.9.1 Available View build log
0.9 Available View build log
0.8 Available View build log
0.7.1 Available View build log
0.7 Available View build log
0.6.4 Available View build log
0.6.2 Available View build log
0.6.1 Available View build log
0.6 Available View build log
0.5.3 Available View build log
Linux (32-bit)
1.3 Available View build log
1.2 Available View build log
1.1.2 Available View build log
1.1.1 Available View build log
1.1 Available View build log
1.0.1 Available View build log
0.9.2 Available View build log
0.9.1 Available View build log
0.9 Available View build log
0.8 Available View build log
0.7.1 Available View build log
0.7 Available View build log
0.6.4 Available View build log
0.6.2 Available View build log
0.6.1 Available View build log
0.6 Available View build log
0.5.3 Available View build log
Linux (64-bit)
1.3 Available View build log
1.2 Available View build log
1.1.2 Available View build log
1.1.1 Available View build log
1.1 Available View build log
1.0.1 Available View build log
0.9.2 Available View build log
0.9.1 Available View build log
0.9 Available View build log
0.8 Available View build log
0.7.1 Available View build log
0.7 Available View build log
0.6.4 Available View build log
0.6.2 Available View build log
0.6.1 Available View build log
0.6 Available View build log
0.5.3 Available View build log
 
Author
License
MIT
Dependencies
Lastest release
version 1.3 on Mar 19th, 2013
Build Status

Django Compressor combines and compresses linked and inline Javascript or CSS in a Django templates into cacheable static files by using the compress template tag.

HTML in between {% compress js/css %} and {% endcompress %} is parsed and searched for CSS or JS. These styles and scripts are subsequently processed with optional, configurable compilers and filters.

The default filter for CSS rewrites paths to static files to be absolute and adds a cache busting timestamp. For Javascript the default filter compresses it using jsmin.

As the final result the template tag outputs a <script> or <link> tag pointing to the optimized file. These files are stored inside a folder and given an unique name based on their content. Alternatively it can also return the resulting content to the original template directly.

Since the file name is dependend on the content these files can be given a far future expiration date without worrying about stale browser caches.

The concatenation and compressing process can also be jump started outside of the request/response cycle by using the Django management command manage.py compress.

Configurability & Extendibility

Django Compressor is highly configurable and extendible. The HTML parsing is done using lxml or if it's not available Python's built-in HTMLParser by default. As an alternative Django Compressor provides a BeautifulSoup and a html5lib based parser, as well as an abstract base class that makes it easy to write a custom parser.

Django Compressor also comes with built-in support for CSS Tidy, YUI CSS and JS compressor, the Google's Closure Compiler, a Python port of Douglas Crockford's JSmin, a Python port of the YUI CSS Compressor cssmin and a filter to convert (some) images into data URIs.

If your setup requires a different compressor or other post-processing tool it will be fairly easy to implement a custom filter. Simply extend from one of the available base classes.

More documentation about the usage and settings of Django Compressor can be found on django-compressor.readthedocs.org.

The source code for Django Compressor can be found and contributed to on github.com/jezdez/django_compressor. There you can also file tickets.

The in-development version of Django Compressor can be installed with pip install django_compressor==dev or easy_install django_compressor==dev.

Subscribe to package updates

Last updated Mar 19th, 2013

Download Stats

Last month:4

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.