I've got a django app that I'm moving to rackspace. I have a model that uses FileFields and I'm using the django-storages library s3/boto backend. I want to use cloudfiles for storage, and I need to be able to serve up the old s3 content.
On a template page where I provide links to the files, I do this:
href="{{ static_url }}{{ article.code_archive_file}}"
static_url
is set from the view and equals settings.STATIC_URL
. Clearly this isn't going to work since settings.STATIC_URL
is going to change when I switch from s3.
Do I need to write a script to migrate all of my s3 files by hand to cloudfiles and also go through and update all the FileFields in my tables? (ugh). I'd rather be able to change out the storages backend and leave the old material in the s3 bucket.
If I do need to migrate the files and the fields, has someone already written a script for that?
bonus question: What best-practices didn't I follow when doing this? I've only been using django for about half a year now.