Django: auto minifying css/js files before release

dzida picture dzida · Jun 17, 2010 · Viewed 26.9k times · Source

I have following case: I want to use uncompressed js/css files during development (to debug js for example) but on production I want to switch automatically to minified versions of that files.

some simple solution is to put in your template:

<script src="some_js.{% if not debug %}min.{% endif %}js"....

but this require manully providing that such file exist and to do minifaction manullay after original file change.

How do you accomplish this in your projects? Is there any tool for this?

Answer

Rick Westera picture Rick Westera · Dec 8, 2011

Django-compress is no longer being maintained. Try https://github.com/cyberdelia/django-pipeline instead.