Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Buildout recipe for Django

Project Description


isotoma.recipe.django can be used to install Django. It's a whole lot like
djangorecipe except that Django is treated like a proper egg.

This recipe will make three scripts available in your bin/ directory (assuming
the control-script option is not set):

This script works in exactly the same way as the script found in
any typical django project; for example, you can run "bin/django syncdb".

This script is the equivalent of the project-independent django-admin script
available when django is installed using apt or easy_install.

An optional script, created if the wsgi option is set to "true". This script
is designed to be called by a web server.

The entire recipe assumes that your project is an egg and any apps contained
within your project *do not* need to be on sys.path and hence refer to each
other as::

from yourproject.yourapp import models



parts = django
versions = versions
eggs =

recipe = isotoma.recipe.django
project = foo
settings = production
wsgi = true
eggs = ${buildout:eggs}

Django = 1.3.1

Supported Options

The name of your django project, be it a develop egg or a regular one. Note
that isotoma.recipe.django will *not* create a project for you if it does
not exist.

The name of the settings file `within your project` to use, allowing you to
create a containing development settings, and a
importing the development settings and overriding them where necessary.
That way you just need to change this value from "settings" to "production".
Defaults to "settings".

Any extra paths to add to sys.path that should be made available to your
project egg / develop-egg.

Defaults to false. If 'true', create a bin/django.wsgi script that can be
added to a webserver configuration (using isotoma.recipe.apache for
example - see below).

This feature appends the buildout bin/ directory to os.environ['PATH'] so
that your django project will have access to the buildout executables.
For example, this might be useful if you install sphinx in your buildout
build and want access to the sphinx executables from within django (as is
the case in the project).

environment.celery = "django"

Used to make more environment variables available to your django project.
Any value can be added after the "environment.". The example above adds::

os.environ["celery"] = "django"

to the django management scripts.

The name of the main management script. Defaults to "django" so if your
buildout:bin-directory = "bin" (as is the default), your management script
will be located at "bin/django", and your wsgi script at "bin/django.wsgi".

The eggs that you'd like to make available to your django project.

Provide a set of extra settings to override the django settings in your
project, e.g.::

extra-settings =
DATABASES['default']['USER'] = 'username'
DATABASES['default']['PASSWORD'] = 'password'

A settings file made up of your project settings and the extra settings is
then compiled in parts, added to the sys.path, then set as the django
settings environment variable in the generated control script in your


This project is actively maintained, and bugs can be reported to

Example with isotoma.recipe.apache

This example shows how

- isotoma.recipe.django,
- `isotoma.recipe.apache <>`_
- `isotoma.recipe.facts <>`_
- `isotoma.recipe.eggpaths <>`_

can be combined to create the wsgi script and an apache configuration that can
run that script. The generated apache config simply needs to be symlinked into
/etc/apache2/sites-available and you're away.


parts =
versions = versions
eggs =

recipe = isotoma.recipe.django
project = foo
settings = production
wsgi = true
eggs = ${buildout:eggs}

recipe = isotoma.recipe.eggpaths
eggs =

recipe = isotoma.recipe.facts

recipe = isotoma.recipe.apache:wsgi
interface = ${facts:interface.eth0.address}
sitename =
serveradmin =
daemon = True
user = ${}
group = ${:user}
processgroup = ${django:project}
processes = 5
threads = 10
wsgi = django.wsgi
static_aliases = /admin/media:${eggpaths:Django}/django/contrib/admin/media

Django = 1.3.1


3.1.5 (2011-12-08)

- Added an extra-settings option to inject settings lines from our buildout

3.1.4 (2011-10-25)

- Fix bug preventing update of django script working-set.

3.1.3 (2011-10-13)

- Documentation release - fleshed out the README documentation.

3.1.2 (2011-10-06)

- Buildout now cleans up the django script where necessary.
- The recipe no longer depends upon Jinja2.
- Added a buildout configuration and empty project to the recipe as quick dirty
recipe test.
- Environment variables can now be added to the bin/django(.*) scripts allowing,
for example, the addition of os.environ['CELERY_LOADER'] = 'django'.

3.1.1 (2011-09-18)

- Capitalise Jinja2 properly in dependencies so that it can be pinned properly
- Added new option: "bin-on-path" which, if true, will add the buildout
bin-directory to os.environ['PATH'] in each django script.

3.1.0 (2011-09-14)

- Eggs were never being installed due to a bug that used the working set in
offline mode. Now we inherit from zc.recipe.egg.Egg which gives us a standard
working_set method for correctly determining working_set.

3.0.3 (2011-09-14)

- Fixed extra-paths bug where a blank extra-paths option would add the cwd.
- Made the recipe PEP-8 compatible.

3.0.2 (2011-06-30)

- Adds apps to installed apps in the settings
- Creates a test runner that can run the created apps
- Creates an initial for the app
- Creates a with sensible defaults, including serving static files in debug mode
- Creates a and heirachy, to enable settings overriding
- Can download django from a specific URL
- Added extra-paths option to append paths to sys.path in the bin/django* scripts.


- Ground up rewrite, to use the django egg, rather than downloading a tarball.
This has removed the ability to use the SVN trunk


- Added the server_email buildout setting.
Will set SERVER_EMAIL in the, so email can be correctly sent out from the server


- Added the creation of for staging environment deployments
- The project path is now correctly added to the buildout


- Documentation updated


- Forked from djangorecipe and renamed to isotoma.recipe.django.


- The recipe know makes the `django` package know to setuptools during install.
This closes #397864. Thanks to Daniel Bruce and Dan Fairs for the patch.

- Fixed #451065 which fixes a problem with the WSGI log file option.

- Added the posibilty to configure more FCGI related settings. Thanks to Vasily
Sulatskov for the patch.


- The generated WSGI & FCGI scripts are now properly removed when
options change (fixes #328182). Thanks to Horst Gutmann for the

- Scripts are now updated when dependencies change. This fixes #44658,
thanks to Paul Carduner for the patch.


- Applied fix for the change in WSGI script generation. The previous
release did not work properly.


- When running again with non-newest set the recipe will no longer
update the Subversion checkout. Thanks to vinilios for the patch.

- The WSGI and FCGI scripts are now generated using Buildout's own
system. This makes them more similar to the generated manage script
with regard to the setup of paths. Thanks to Jannis Leidel for the


- Paths from eggs and extra-paths now get precedence over the default
system path (fixes #370420). Thanks to Horst Gutmann for the patch.

- The generated WSGI script now uses the `python` option if
present. This fixes #361695.


- Fixed a problem when not running in verbose mode (fixes #375151).


- Removed dependency on setuptools_bzr since it does not seem to work
like I expected.


- Changed the download code to use urllib2. This should make it work
from behind proxies (fixes #362822). Thanks to pauld for the patch.


- Fixed a problem with the new WSGI logging option #348797. Thanks to
Bertrand Mathieu for the patch.

- Disable generation of the WSGI log if "wsgilog" isn't set, thanks to
Jacob Kaplan-Moss for the patch.

- Updated buildout.cfg and .bzrignore, thanks Jacob Kaplan-Moss.


- Added an option to specify a log file for output redirection from
the WSGI script. Thanks to Guido Wesdorp for the patch.


- Subversion aliases are now supported (something like
svn+mystuff://myjunk). Thanks to Remco for the patch.


- Update to move pth-files finder from the __init__ method to the
install method so it runs in buildout-order, else it looks for pth
files in dirs that may not yet exist. Thanks to Chris Shenton for
the update to his original patch.


- Update to make the previously added pth-files option better


- Added "pth-files" option to add libraries to extra-paths from
site .pth files. Thanks to Chris Shenton for the patch.


- The recipe now supports creating a FCGI script. Thanks to Jannis
Leidel for the patch.

- When downloading a Django recipe for the first time the recipe now
properly reports the url it is downloading from.


- Specifying a user name within a subversion url now works. The code
that determined the revision has been updated. This fixes issue
#274004. Thanks to Remco for the patch.

- Updated the template for creating new projects. It now uses the
current admin system when generating it's `` file. This fixes
issue #276255. Thanks to Roland for the patch.


- Re-upload since CHANGES.txt was missing from the release


- The recipe no longer executes subversion to determine whether the
versions is to be downloaded using subversion. This fixes issue
#271145. Thanks to Kapil Thangavelu for the patch.

- Changed the `pythonpath` option to `extra-paths`. This makes the
recipe more consistent with other recipes (see issue #270908).


- Another go at fixing the updating problem (#250811) by making sure
the update method is always called. It would not be called in the
previous version since the recipe wrote a random secret (if it
wasn't specified) to the options for use with a template. Buildout
saw this as a change in options and therefore always decided to
un-install & install.

- When both projectegg and wsgi=True are specified, the generated wsgi
file did not have the correct settings file in it. This has been
fixed with a patch from Dan Fairs.

- The recipe now has logging. All print statements have been replaced
and a few extra logging calls have been added. This makes the recipe
more informative about long running tasks. Thanks erny for the patch
from issue #260628.


- The recipe no longer expects the top level directory name in a
release tarball to be consistent with the version number. This fixes
issue #260097. Thanks to erny for reporting this issue and
suggesting a solution.

- Revision pinns for the svn checkout now stay pinned when re-running
the buildout. This fixes issue #250811. Thanks to Remco for
reporting this.

- Added an option to specify an egg to use as the project. This
disables the code which creates the basic project structure. Thanks
to Dan Fairs for the patch from issue #252647.


- Fixed the previous release which was broken due to a missing
manifest file


- The settings option is fixed so that it supports arbitrary depth
settings paths (example; `conf.customer.development`).

- The version argument now excepts a full svn url as well. You can use
this to get a branch or fix any url to a specific revision with the
standard svn @ syntax

- The wsgi script is no longer made executable and readable only by
the user who ran buildout. This avoids problems with deployment.

Release History

This version
History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(16.7 kB) Copy SHA256 Hash SHA256
Source None Dec 8, 2011

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Kabu Creative Kabu Creative UX & Design Google Google Cloud Servers Fastly Fastly CDN StatusPage StatusPage Statuspage DigiCert DigiCert EV Certificate