Repeatable Django installations

Don’t you hate it when you have to spend lots of time tracking down dependencies etc. when joining an existing a project? Did you know that it doesn’t have to be this way?

Clever folks which where in the same boat as us have created zc.buildout. This tool allows you to easily configure all your software requirements with a simple text file. The example below can be used to install a fully working Django trunk version with ipython and satchmo included.

[buildout]
parts = satchmo django
eggs = ipython

[satchmo]
recipe = gocept.download
url = http://www.satchmoproject.com/snapshots/satchmo-0.6.tar.gz
md5sum = 659a4845c1c731be5cfe29bfcc5d14b1

[django]
recipe = djangorecipe
version = trunk
settings = development
eggs = ${buildout:eggs}
pythonpath =
  ${satchmo:location}
project = dummyshop

This example shows the basic structure of a buildout file. You can turn this into a working environment by adding a bootstrap.py file. After that you can run;

python bootstrap.py

bin/buildout -v

There should now be a bin/django script which does all the things that manage.py would normally do.

The buildout configuration itself consists mainly of a few sections (marked with […]). Each section specifies a recipe to be used. Buildout basically uses these recipes to build django etc. To see what you can do with a recipe you can look-up it’s documentation. In the case of django you can find it at djangorecipe’s documentation page.

There are many more recipe’s at the package index to do all sorts of interesting things. So please do yourself a favour and give buildout a spin.

Advertisements

1 comment so far

  1. pos.thum.us on

    Nice short intro with just the basics, good one Jeroen!.
    Thanks for the write-up.

    buildout deserves a lot more good press, it can save a lot of headaches.


Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: