Using Capistrano to Deploy/Maintain Django Applications

139 views
Skip to first unread message

snew...@gmail.com

unread,
Jan 13, 2007, 11:10:44 AM1/13/07
to Django developers
Has anyone used Capistrano with Django? I have been looking for
documentation, and the Cap manual uses RoR for its examples - it's not
very approachable for someone doing application deployment outside of
that framework.

I've found sparse information on deploying non-Rails apps, but I've had
a hard time making heads or tails of them, and haven't found any
complete recipes.

If anyone has some experience and wouldn't mind answering some basic
questions, I'd be grateful.

Specifically, I'm looking to:

1. Deploy/Update applications from SVN to multiple web servers
2. *Possibly* run nightly cleanup/administrative tasks on multiple web
servers - I'm thinking it's easier to manage cron tasks on one
deployment server than each server independently

It seems like the basic idea is you create a task in your recipe, then
specify that task as a command line argument. (Unfortunately, that's
about as far as I've gotten with it)

p.s. - Since I expect to hear this: Yes, I would prefer to use a pure
Python tool, but I don't want to reinvent the wheel if a capable open
source tool exists.

Jeremy Dunck

unread,
Jan 15, 2007, 8:26:37 AM1/15/07
to django-d...@googlegroups.com
On 1/13/07, snew...@gmail.com <snew...@gmail.com> wrote:
>
> Has anyone used Capistrano with Django? I have been looking for
> documentation, and the Cap manual uses RoR for its examples - it's not
> very approachable for someone doing application deployment outside of
> that framework.

Maybe post of django-users?

I looked at using Capistrano (nee` Switchtower) when starting work at
Pegasus, but at the time, we only had 1 db and 1 web server, so after
fiddling with it for about an hour I decided to put away my toys. :)

I guess that's to say I got about as far as you...

Jacob Kaplan-Moss

unread,
Jan 15, 2007, 9:55:50 AM1/15/07
to django-d...@googlegroups.com
On 1/13/07 10:10 AM, snew...@gmail.com wrote:
> Has anyone used Capistrano with Django? I have been looking for
> documentation, and the Cap manual uses RoR for its examples - it's not
> very approachable for someone doing application deployment outside of
> that framework.

We've started using it here at World Online; so far it seems to work great.

I can't really take any credit for the customizations we use -- our sysadmin
wrote them -- but I can tell you that we pretty much wrote an entire set of
custom tasks. In essence, we just use Cap's abilities to execute commands on
multiple servers, and it works quite well.

Jacob

lbolo...@gmail.com

unread,
Jan 15, 2007, 11:08:55 AM1/15/07
to Django developers
On Jan 13, 5:10 pm, "snewma...@gmail.com" <snewma...@gmail.com> wrote:
> Has anyone used Capistrano with Django? I have been looking for
> documentation, and the Cap manual uses RoR for its examples - it's not
> very approachable for someone doing application deployment outside of
> that framework.
> p.s. - Since I expect to hear this: Yes, I would prefer to use a pure
> Python tool, but I don't want to reinvent the wheel if a capable open
> source tool exists.

In my quest to generally keep-it-simple i'm planning to roll my own
using something like paramiko (written in Python)

http://www.lag.net/paramiko/docs/paramiko.SSHClient-class.html

client = SSHClient()
client.load_system_host_keys()
client.connect('ssh.example.com')
stdin, stdout, stderr = client.exec_command('ls -l')

This looks simple enough.

Any drawbacks in this kind of approach?

Lorenzo

snew...@gmail.com

unread,
Jan 19, 2007, 10:28:13 AM1/19/07
to Django developers
I would be all for that approach, as my needs are pretty simple. Please
keep me informed of your progress, I'd love to try it out.

Reply all
Reply to author
Forward
0 new messages