Django-pipe amazon s3 collectstatic file not found.

I use s3boto, django-pipeline and django-storages with this parameter:

DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage' STATICFILES_STORAGE = 'utils.classutils.S3PipelineStorage' MEDIA_ROOT = "/" MEDIA_URL = '//s3.amazonaws.com/%s/' % AWS_STORAGE_BUCKET_NAME STATIC_ROOT = '/static/' STATIC_URL = '//s3.amazonaws.com/%s/static/' % AWS_STORAGE_BUCKET_NAME STATICFILES_DIRS = ( os.path.join(SITE_ROOT, 'assets'), ) 

and this is custom repository for django pipeline

 from django.contrib.staticfiles.storage import CachedFilesMixin from pipeline.storage import PipelineMixin from storages.backends.s3boto import S3BotoStorage class S3PipelineStorage(PipelineMixin, CachedFilesMixin, S3BotoStorage): pass 

but I keep getting:

 ValueError: The file 'project/head.png' could not be found with <utils.classutils.S3PipelineStorage object at 0x2163510>. 

but this file does not exist anywhere! not in plugins, I tried to find it, I checked my static dirs, tried to find it in admin, and I don’t even remember how it worked with the file named like that! I tried findstatic and the file was not found.

What can I lose?

+4
source share
2 answers

You probably have a css file pointing to a non-existent file 'project/head.png' , delete this link and it should work.

+3
source

A short hint. I came across this when I configured S3 to serve static files.

I wanted to use static content from s3 and continue to process downloaded files in the media folder on the local computer. Then I had one image referenced by a css file on s3 that pointed to an image in a media folder, like this background: url(../media/some/image.png) .

Obviously, the file cannot be found in s3 with the relative path that was set in css and the download was broken. It works locally, but not when running staticfiles from s3.

+1
source

All Articles