Setup a complete Django server, deploy, rollback – all in one powerful script.
askthepony.com
askthepony.com
I'll say this though: while fabric is _ok_ at configuration management and provisioning new servers/instances, it's absolutely dwarfed by real tools for that kind of job. If you value your sanity and want another excellent tool in your arsenal, look into using Chef or Puppet for building servers (with a dose of Blueprint for reverse-engineering your existing requirements). Fabric is great at everything else it does, but for building new servers it's very flimsy and prone to break, which can cause many a needless headache. I prefer Chef, but Puppet is equally excellent. Do yourself a favor and take the afternoon to learn one or both.
For chef, there is a great tutorial by Opscode about deploying Django applications: http://help.opscode.com/kb/otherhelp/build-a-django-stack
$ git fetch origin
$ git reset --hard origin/<production branch>
A rollback is just:
$ git reset --hard HEAD^
Fetching pulls down the new code, without replacing your production code just yet. Then git reset --hard is a super fast way to point the production server's working copy at the current head of the origin/<production branch>. Saves you the time of having to upload an archive of your entire app the server everytime. However, it also gets complicated if you want to rollback more than one deploy. I've been looking into maybe auto-tagging each deploy and using the tags for rollbacks.
Also, for uploading assets to S3 checkout s3cmd. It has a really nice sync command, that's basically like rsync for s3 --only uploads files that have changed.
[1] https://github.com/blog/470-deployment-script-spring-cleanin...
Since I'm currently diving into Fabric I have to say the very script isn't really pretty (rather hacky). Still, it's useful.
On the other hand one can invest a lot of work initially by using Chef (or Puppet) and never again be bothered with setting up deployment scripts.