A buildout recipe for Django projects
Python JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
djc
.gitignore
CHANGES.rst
CONTRIBUTORS.rst
LICENSE.txt
README.rst
bootstrap.py
buildout.cfg
setup.py

README.rst

Warning

This recipe has been deprecated in favor of djc.recipe2. If you are starting a new project, don't use this package, use djc.recipe2. This package might see minor bug fixes to keep existing buildouts running, but it won't gain new features.

This recipe allows you to setup a Django project through zc.buildout.

Usage

The main scope of the recipe is to abstract out the settings.py file, allowing settings to reside inside the buildout instead of having them reside into code (leading to an awkard handling of the same in respect to versioning, for example). The settings.py file is generated by a template, either the default one, the default one and a user extension, or a totally new one.

The template uses the Tempita_ templating system.

The most basic usage of this recipe is as follows:

[buildout]
parts = django

[django]
recipe = djc.recipe
project = my.project

Where my.project is an importable package containing a urls module and a templates directory.

As you see, very few options are specified here: the defaults are used to build up the settings.py file.

Of course, real examples tend to be slightly more complex: see Options_, `Default template options`_ and `Example usage`_ for more details.

Running tests

The README.txt located within the package also acts as main doctest.

To run the tests, check out the source, and then bootstrap and run the buildout:

$ python bootstrap.py
$ bin/buildout

Then you can run the tests using:

$ bin/test

Links