Skip to content

liqd/a4-meinberlin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

  • nodejs (+ npm)
  • python 3.x (+ venv + pip)
  • libmagic
  • libjpeg
  • libpq (only if postgres should be used)
  • gdal
  • sqlite3 with JSON1 enabled(only if sqlite is used for local development)
  • redis (in production, not needed for development)

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:

  • the redis server is running
  • the celery config parameter "always eager" is disabled (add 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

(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:

  • the redis server is running
  • the celery worker is running (see previous step)

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