Django-compressor on s3 does not recognize and copy updated files

236 views Asked by At

I am using Django, django-compressor, django-storages to put static files for my site onto s3. I am able to get them onto s3, but when I make a modification to a file, and then run collect static, it reports that there were no modified files.

I did just modify a file, so I'm wondering if this is a timestamp issue somewhere on the server, somewhere on s3, or an inconsistency somewhere else.

I've been looking at the source of collect static ( https://github.com/django/django/blob/master/django/contrib/staticfiles/management/commands/collectstatic.py#L286 )

and it seems it will give the message

Skipping ...

instead of

Copying

if it has already copied it, but it is not clear to me why it would think it is already copied if it us updated.

Maybe I am misunderstanding the docs on compressor or staticfiles, but it seems to me it should already handle collecting and processing the file when it is updated, but it still says (not modified).

1

There are 1 answers

0
bogeylicious On

I've run into a few issues with django-storages and the S3Boto backend. Try this for some troubleshooting...

Make sure you have python-dateutil installed (see this thread):

pip install python-dateutil==1.2

Make sure you have appropriate settings for django-compressor and django-storages:

AWS_PRELOAD_METADATA = True
COMPRESS_STORAGE = 's3_storages.StaticRootS3BotoStorage'