Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django + SVN + Deployment

I'm a strong proponent of version control, and am starting work on a Django project. I've done a few before, and have tried a few different approaches, but I haven't yet found a decent structure that I actually feel comfortable with.

Here's what I want:

a) Source code checked into version control

b) Preferably the environment is not checked into version control (something like buildout or pip requirements.txt is fine for setting up the environment)

c) A reasonable "get a new developer going" story

d) A reasonable deployment story - preferably the entire deployment environment could be generated by a script on the server

It seems to me like someone has to have done this before, but many hours of searching have all led to half-baked solutions that don't really address all of these.

Any thoughts on where I should look?

like image 399
Tony Arkles Avatar asked Nov 06 '10 20:11

Tony Arkles


1 Answers

Look at fabric to manage deployments.

This is what I use to manage servers/deployments with fabric: louis (it is just a collection of fabric commands). I keep a louisconf.py file with each project.

I'd recommend using a distributed VCS (git, hg,...) instead of svn. The reason being that the ease of branching allows for several schemes for deployment. You can have, for example, production and staging branches. Then you enforce that the only merges into production happen from staging by convention.

As for getting developers started quickly you have it right with pip and requirements.txt. I think that also means that you are using virtualenv, but if not that's the third piece. I'd recommend getting a basic README in place. Have the first assignment of each developer that joins a project be to update the README.

The rough way to get someone on board is to have her checkout the code, create a virtualenv, and install the requirements.

I'd recommend having a settings.py file that works with sqlite3 and such that a new developer can use to just get going fast (ie after installing the requirements). However, how you manage the different settings files depends on your project layout. There should be some set of default settings for new developers to use, though.

like image 191
rz. Avatar answered Nov 09 '22 00:11

rz.