jschneier/django-storages-redux — pull request #10 by coredumperror (2014-12-17 23:34:45+00:00)
Title: Added manage.py store_media command.

Hi! Thanks so much for taking command of the django-storages app, as my team will absolutely be using it for our new website.

In order to support a scenario that we're likely to run into (having to upload files from an existing django site into the newly-configured S3 bucket) I added a `manage.py` command to django-storages-redux called `store_media`. It's almost entirely a clone of Django's `collectstatic` command, with several tweaks to make it take files from MEDIA_ROOT and copy them into the DEFAULT_FILE_STORAGE backend.

Admittedly, I haven't written any tests yet, though I haven tested the command quite thoroughly by running it with the s3boto backend several times. And about 95% of the functional code is a direct copy from `collectstatic`, with the primary changes being updating the string formatting to use `.format()`, and removing symlink support.