These last few weeks I’ve been working on an outside project that is written in Django (thanks to the involvement of one of the two coders behind Polihood). When it came time to deploy this app to our dev server, we started looking at the Capistrano deployment tool. Unfortunately the documentation for Capistrano is lacking, but the tool itself is darn slick, so I gave it a go.
Capistrano was built as a deployment manager for Ruby on Rails applications, but it has been expanded with additional functionality, and seems to be slowly moving towards being a general-purpose tool. I’ve seen other tutorials written about using Capistrano to deploy web apps that aren’t Rails, but generally they consist of sticking a bunch of shell commands into a Capfile and letting it run, which doesn’t really seem to be the “Capistrano way.”
What I’ve done is use Capistrano’s built in Rails deploy functionality and have been writing overrides as I find that I need them. Right now the script only does a basic deploy or rollback, but eventually I’ll probably extend it to do other things as well.
Remarkably, very little needs to change in the standard deploy library to work with Django. Here is my Capfile as it currently stands.