Creating the environment

For the people wanting to develop e-cidadania, we recommend to setup a new environment using buildout.

We assume you this this steps:

  • Clone the repository (or download a copy of a stable release)
  • Install all the required dependencies in requierements.txt

If you didn’t, please take a look to Installation Steps —–

Below are the steps explained in a greater detail.

Now buildout will run and download all the packages required for development in the e-cidadania.eggs folder and add them to the python path of the bin/django script which will be created after buildout runs successfully.

buildout will download the django framework itself and other packages as defined in buildout.cfg. bin/django is a wrapper around and works exactly the same way as and it must be used to run any django management commands while you are in the development environment.


On some linux systems, running bin/buildout fails when installing PIL. The solution is to install python-imaging and in some environments python-devel too. Install python-imaging and re-run bin/buildout.

If the step above completes sucessfully, you will find a number of scripts in bin folder. Make sure that you have django and python in the bin folder.

That’s it!

Running the tests

We have drifted away from the Django way of keeping the tests with the source itself. All the tests are in a single folder called ‘tests’ which you can find at the root of e-cidadania. By default, the test runner is configured to run all the tests present in the test folder.

  • To run all the tests:

    ~/e-cidadania$ bin/django test

or when you are in src:

~/e-cidadania/src$ ../bin/django test
  • To run the tests with coverage:

    ~/e-cidadania$ bin/django test --with-cov

or when you are in src:

~/e-cidadania/src$ bin/django test --with-cov