Note that there are some explanatory texts on larger screens.

plurals
  1. POConfiguring django-compressor with remote storage (django-storage - amazon s3)
    primarykey
    data
    text
    <h1>My scenario</h1> <p>I'm using django-storage to have the files served via Amazon S3. This means that when I do ./manage.py collectstatic, the files will be saved on my bucket at amazon and not on the local file system.</p> <p>To compress the files I do: "./manage.py compress" Which gives this error:</p> <p>Error: An error occured during rendering: [Errno 2] No such file or directory: u'/home/user/project/static/less/bootstrap.less'</p> <p>Since the file isn't on my local filesystem.</p> <p>"Due to the way Django Compressor processes files, it requires the files to be processed (in the {% compress %} block) to <strong>be available in a local file system cache.</strong>" <a href="http://django_compressor.readthedocs.org/en/latest/remote-storages/">http://django_compressor.readthedocs.org/en/latest/remote-storages/</a></p> <h2>Question</h2> <p>How do I make django-compress work with django-storage (amazon s3)?</p> <h2>What I've tried to do so far</h2> <p>Make collectstatic save files both local and on S3. Since it's mentioned mentioned in the documentation at the django-compressor page, there should be some good way to do it. How?</p> <h1>Configuration</h1> <pre><code>STATIC_URL = 'http://mybucket.s3-website-eu-west-1.amazonaws.com/' STATIC_ROOT = os.path.join(PROJECT_DIR,"static/") STATICFILES_FINDERS = ( 'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', 'compressor.finders.CompressorFinder', ) STATICFILES_STORAGE = DEFAULT_FILE_STORAGE = 'index.storage.CachedS3BotoStorage' #defined as it is in the documentation AWS_ACCESS_KEY_ID = "xxx" AWS_SECRET_ACCESS_KEY = "xxx" AWS_STORAGE_BUCKET_NAME = "xxxx" COMPRESS_URL = STATIC_URL COMPRESS_OFFLINE = True COMPRESS_PRECOMPILERS = ( ('text/less', 'lessc {infile} {outfile}'), ) </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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