Serve different Static files on devel and production in Django -
i have production , local django development environment. push things production have deployer minifies , gzips css , js files.
to serve them on production need call them
<link rel="stylesheet" href="{{ static_url }}css/filename.min.css.gz">
however on development want normal css file served (that way don't have re-minify , gzip each time save) with:
<link rel="stylesheet" href="{{ static_url }}css/filename.css">
is there way achieve , automatize behaviour adding deployer?, there other work-around (i rid of .min extension if it's possible add .gz in clean way?
i want note know implement html-parser adds on each deploy i'm looking neat , django oriented solution.
as usual, there's django package that! there 2 use:
django-compressor: http://django-compressor.readthedocs.org/en/latest/ django-pipeline: https://django-pipeline.readthedocs.org/en/latest/
i started on django-pipeline have moved using compressor of late. see docs, believe 1 you're looking for. luck!
Comments
Post a Comment