[Chicago] deploying django apps, first steps for newbie

Andy Boyle andymboyle at gmail.com
Wed Nov 20 18:08:53 CET 2013

Sheila, have you ever used Fabric? At the Chicago Tribune, we have
automated deployment tools set up using Fabric, which automatically sshes
onto our staging/production environments, activates the virtual
environments, then does a git fetch to bring in the latest changes then
restarts the app and reloads nginx. It makes it real simple to make sure
our software is the same among our local, staging and production

We also have a bootstrap command to set up new projects on our existing
staging/production rigs. It automatically creates the database(s), sets up
the virtual environments, pip installs everything in our requirements.txt,
etc. We try to make projects that don't require us needing to ssh into
servers, but instead we just write Fabric commands that do that for us,
which is especially helpful if you have a project running across multiple
AWS EC2 instances behind a load balancer or something.

As for installing git on your production environment, that's what we use to
deploy our projects, so I'm not sure why it'd necessarily be a bad thing to
have. I'd love to hear someone's arguments to the contrary.

Good luck!

*Andy Boyle | Chicago Tribune*
News Applications Developer
@andymboyle | andymboyle.com <http://www.andymboyle.com>

On Wed, Nov 20, 2013 at 10:46 AM, sheila miguez <shekay at pobox.com> wrote:

> Okay, let's say I have a site in production that is somewhat organized
> according to this excellent blog post, <
> http://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/
> >.
> For every new release, I could write something that fetches a tarball from
> github for the release, makes a new virtualenv specific to that release,
> and untars the repo following the convention in that blog post. I would
> keep some number of old virtualenvs around for a while. That's my newbie
> idea, and I'd like to know what best practices are for this kind of stuff.
> More newbie questions:
> worse practices
> * how bad is it that I pip install things that require compiling on my
> production box (psycopg2 for example)?
> * how bad is it to install git on my production box?
> Eventually I think I'll set up my own pypi. I think I could also try and
> figure out how to make packages for things like psycopg2 so I don't need to
> compile them. (assuming there is some reason I wouldn't want to use a
> distro's package? is there?)
> --
> sheila
> _______________________________________________
> Chicago mailing list
> Chicago at python.org
> https://mail.python.org/mailman/listinfo/chicago
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/chicago/attachments/20131120/3c2e4768/attachment.html>

More information about the Chicago mailing list