Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to make django-storage and django-pipeline work together
    text
    copied!<p>I want to use both django-pipeline and django-storage on heroku for a personal app. Using only django-pipeline works perfectly, using only django-storage works like a charm but I don't manage to get both of them work together :(</p> <p>When you read docs, you will find this to make both work with collecstatic:</p> <p><strong>Django-pipeline:</strong></p> <pre><code>settings.py STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage' PIPELINE_CSS = { 'app': { 'source_filenames': ( 'css/*', ), 'output_filename': 'css/min.css', 'variant': 'datauri', }, } </code></pre> <p><strong>Django-Storage</strong></p> <pre><code>settings.py STATICFILES_STORAGE = 's3storages.StaticStorage' s3storages.py from storages.backends.s3boto import S3BotoStorage StaticStorage = lambda: S3BotoStorage( bucket='app_name', location='assets' ) </code></pre> <p>So both app needs to set STATICFILE_STORAGE; when i set storage for amazon s3; django-pipeline doesn't create min.css and min.js...</p> <p>So i found <a href="https://stackoverflow.com/questions/9608969/django-pipeline-and-s3boto-storage-dont-seem-to-work-together">this solution on stack</a> and did the following:</p> <pre><code>from staticfiles.storage import CachedFilesMixin from pipeline.storage import PipelineMixin from storages.backends.s3boto import S3BotoStorage class S3PipelineStorage(PipelineMixin, CachedFilesMixin, S3BotoStorage): pass # Define bucket and folder for static files. StaticStorage = lambda: S3BotoStorage( bucket='app_name', location='assets' ) </code></pre> <p>Now, each time I use collectstatic command, static files are send to amazon S3 but django-pipeline min.css and min.js are not sent... There is no trace of them in my STATIC_ROOT directory also....</p> <p>Do you know how I can use both together?</p> <p><strong>EDIT 1:</strong></p> <p>Now in I have this: (I changed s3storage :) )</p> <pre><code>settings.py STATICFILES_STORAGE = 's3storages.StaticStorage' s3storage.py from staticfiles.storage import CachedFilesMixin from pipeline.storage import PipelineMixin from storages.backends.s3boto import S3BotoStorage class S3PipelineStorage(PipelineMixin, CachedFilesMixin, S3BotoStorage): pass # Define bucket and folder for static files. StaticStorage = lambda: S3PipelineStorage( bucket='app_name', location='assets' ) </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload