Hey all!

This is a feature request / proposal (one which I'm willing to build out,
given that I've already developed a solution for my own uploader).

I run a consulting business that helps small startups build initial MVPs.
When the time ultimately comes to deciding how to store static assets, my
preference (as is that of many others) is to use Amazon S3, with Amazon
CloudFront acting as a CDN to the appropriate buckets. For the purposes of
this ticket, s/S3/your object storage of choice/g.

Now, Django has an awesome mechanism for making sure static assets are up
on S3. With the appropriate static storage backend, running ./manage.py
collectstatic just searches through your static media folders and copies
the files.

The problem I've run into is that collectstatic copies all files,
regardless of whether they already exist on the destination. Uploading
5-10MB of files is pretty wasteful (and time consuming) when none of the
files have changed and no new files have been added.

As I wrote in the trac ticket (https://code.djangoproject.com/ticket/19021),
my current solution was to write a management command that does essentially
the same thing that collectstatic does. But, there are a few differences.
Here's a rundown (copied straight from the trac ticket).

I currently solve this problem by creating a file containing metadata of
> all the static media at the root of the destination. This file is a JSON
> object that contains file paths as keys and checksum as values. When an
> upload is started, the uploader checks to see if the file path exists as a
> key in the dictionary. If it does, it checks to see if the checksums have
> changed. If they haven't changed, the uploader skips the file. At the end
> of the upload, the checksum file is updated on the destination.


I'll contribute the patch. I know there is not a lot of time before the
feature freeze, but I'm willing to make this happen if there's interest.

If we don't want to change behavior, perhaps adding a flag such as
--skip-unchanged-files to the collectstatic command is the way to go?

All the best,
Dan

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to