Project configuration


Project configuration is made with the buildout configuration files. By default there is only two cfg files; buildout.cfg and dev.cfg.

It is possible to create stage specific configuration by adding cfg files named after the stage name which extends buildout.cfg.

For example, if I have a stage named prod on which I want to configure cron jobs, I simply have to create a prod.cfg file in which I put the required configuration.

At deploy time, duke will use prod.cfg instead of buildout.cfg.


The main configuration is buildout.cfg, it should be complete and functional stand alone as this is the configuration used in production.


This configuration file is used only for development, it extends buildout.cfg.

You can extend individual configurations keys like so:

extends = buildout.cfg

# extend
eggs +=

If you wish to overwrite it instead, simply remove the + sign.



Directive Default Description
django ${buildout:directory}/.duke/bin/django Shortcut to django executable
cron ${buildout:directory}/cron/ Path where cron jobs script are stored


Directive Default Description
allowed-eggs-from-site-packages PIL, MySQL-python, ... Use this directive to tell buildout which system wide package it can use*
auto-checkout djangodukerecipe List of modules sources to auto checkout
develop . List of editable modules to install with develop
eggs none List of eggs to install (project requirements)
exec-sitecustomize false Normally the Python’s real sitecustomize module is not processed
extensions mr.developer Buildout extensions to load
include-site-packages true We allow site packages unless allowed-eggs-from-site-packages is specified
index HTTP URL of pypi (default) or a pypi mirror
newest false Check for new packages versions
parts python, django, scripts Buildout parts to run (ex: python, djangodev)
unzip true Zipped eggs make debugging more difficult and often import more slowly
versions versions Freeze eggs or sources to specific versions
sources sources This specifies the name of a section which lists the repositories
sources-dir src This specifies the directory where your package sources will be placed
auto-checkout src This specifies the names of packages which should be checked out during buildout. Packages already checked out are skipped. You can use * as a wildcard for all packages in sources
always-checkout false This defaults to false. If it’s true, then all packages specified by auto-checkout and currently in develop mode are updated during each buildout run. If set to force, then packages are updated even when they are dirty instead of asking interactively.
always-accept-server-certificate false If it’s true, invalid server certificates are accepted without asking (for subversion repositories)
  • If allowed-eggs-from-site-packages is an empty list, then no eggs from site-packages are chosen, but site-packages will still be included at the end of path lists.


interpreter Name of the Python interpreter (default python)
extra-paths List of paths to add to the PYTHONPATH. Note that you must add paths of modules installed from sources here. The path should look like this: ${buildout:directory}/src/mptt


Directive Default Description
extra-paths ${python:extra-paths}  
settings settings Name of the django settings module
wsgi false  
project false The project name



django = git git://
django-mptt = git git:// branch=reodering_test
django-fiber = git:// update=true

Supported source kinds: svn, hg, git, bzr, darcs, cvs, and fs.

When adding new sources, don’t forget to also add them in to the extra-paths of the [python] section and the auto-checkout in the [buildout] section.




Working with sources

If you work with source packages You need to edit tree configs.

Tell buildout to checkout the package every time:

auto-checkout +=

Then specify the source URL:

[sources] # svn, hg or git
django = git git://

Finally, add it to the environment’s PYTHONPATH like this:

extra-paths +=