mein.berlin is a participation platform for the city of Berlin, Germany. It is based on adhocracy 4.
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
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
If you need to do testing with a proper celery setup.
For celery to register and run tasks you need to make sure that:
CELERY_TASK_ALWAYS_EAGER = False
to your local.py
)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
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
In case of settings.TIME_ZONE change, tasks need to be synced with the new time. See HOWTO