Django Compressor combines and compresses linked and inline Javascript or CSS in a Django template 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 or <link> tag pointing to the optimized file. These files are stored inside a folder and given a unique name based on their content. Alternatively it can also return the resulting content to the original template directly.<br><br>Since the file name is dependent on the content these files can be given a far future expiration date without worrying about stale browser caches.<br><br>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.

Code Quality Rank: L3
Programming language: Python
License: MIT License
Tags: HTTP     Django     Asset Management     Internet     WWW    

django-compressor alternatives and related packages

Based on the "Asset Management" category

Do you think we are missing an alternative of django-compressor or a related project?

Add another 'Asset Management' Package

django-compressor Recommendations

There are no recommendations yet. Be the first to promote django-compressor!

Have you used django-compressor? Share your experience. Write a short recommendation and django-compressor, you and your project will be promoted on Awesome Python.
Recommend django-compressor

Recently added django-compressor resources

Do you know of a usefull tutorial, book or news relevant to django-compressor?
Be the first to add one!