automatically remove source files after collectstatic with django-pipeline -


with django-pipeline, possible automatically remove source files after collectstatic ?

for example :

pipeline_js = {     'stats': {         'source_filenames': (           'js/jquery.js',           'js/d3.js',           'js/application.js',         ),         'output_filename': 'js/stats.js',     } } 

collectstatic :

$ python manage.py collectstatic $ ls static/js jquery.js d3.js application.js stats.js 

(i don't want jquery.js, d3.js, application.js)

django-pipeline sends signals whenever compiles package, can read more in docs, , signals in general here. can hook signal this:

from pipeline.signals import js_compressed  def clear_files(sender, **kwargs):     print kwargs     if 'package' in kwargs:         print kwargs['package'].sources         # here remove unwanted files  js_compressed.connect(clear_files) 

Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -