liqd / a4-meinberlin

The central participation platform of the city of Berlin, Germany
https://mein.berlin.de
GNU Affero General Public License v3.0
40 stars 6 forks source link
berlin citizen-participation civic-tech django e-participation liquid-democracy

Participation platform mein.berlin

mein.berlin is a participation platform for the city of Berlin, Germany. It is based on adhocracy 4.

Build Status Coverage Status

Requirements

Installation (for development and testing only!)

Note: if you are on a mac you need to have gnu sed installed for the following steps to work. Install it via brew:

brew install gnu-sed

Steps to install and run a development server:

git clone https://github.com/liqd/a4-meinberlin.git
cd a4-meinberlin
make install
make fixtures
make watch

(Optional) postgresql database for testing:

If you need to do testing with postgresql as database (usually sqlite is sufficient).

run the following command once:

make postgres-create

to start the testserver with postgresql, run:

export DATABASE=postgresql
make postgres-start
make watch

to remove python venv and npm modules, run:

make clean

Note: if your virtualenv is located outside the project, then the command above it won't remove the python packages. Instead remove them with:

pip uninstall -r requirements/dev.txt

(Optional) celery for task queues

If you need to do testing with a proper celery setup.

For celery to register and run tasks you need to make sure that:

To start a celery worker in the foreground, run:

make celery-worker-start

Stop celery with ctr+C

To inspect all registered tasks, list the running worker nodes, run:

make celery-worker-status

To send a dummy task to the queue and report the result, run:

make celery-worker-dummy-task

See more info about Celery in the docs

(Optional) celery beat for scheduled tasks in development

If you need to do testing with periodical task working.

For celery to run scheduled tasks you need to make sure that:

To start celery beat in the foreground, run:

make celery-beat

Stop celery beat with ctr+C

To add scheduled tasks (same for all environments) check the docs

In case of settings.TIME_ZONE change, tasks need to be synced with the new time. See HOWTO