Development environment

To start with developing on Zou you need Python 3 installed and a Postgres database instance.


To run Postgres we recommend to use Docker (it's simpler and it won't impact your local system):

sudo docker pull postgres
sudo docker run \
    --name postgres \
    -p 5432:5432 \
    -e POSTGRES_PASSWORD=mysecretpassword \
    -d postgres

Key-value store

To run Redis we recommend to use Docker again:

sudo docker pull redis
sudo docker run \
    --name redis \
    -p 6379:6379 \
    -d redis


For video operations, it is required to have FFMPEG installed. For that, simply install it through your OS package manager:

sudo apt-get install ffmpeg

Source and dependencies

Then get Zou sources:

git clone

Install virtualenvwrapper:

pip install virtualenvwrapper

Add configuration for virtualenvwrapper to your .bashrc:

export WORKON_HOME=directory_for_virtualenvs
source ~/.local/bin/

Create a virtual environment with mkvirtualenv:

mkvirtualenv zou
workon zou

Install dependencies:

pip install -r requirements.txt

Init data

Create a database in postgres named zoudb with user postgres and password mysecretpassword. Then init db:

python zou/ clear-db
python zou/ init-db
python zou/ init-data

Create a first user:

python zou/ create-admin --password=mysecretpassword

Run server:


You can now use the API by requesting http://localhost:5000.

Event server

To run the Server Events server used to update the web GUI in realtime, use the following command.

gunicorn --worker-class geventwebsocket.gunicorn.workers.GeventWebSocketWorker -b -w 1 zou.event_stream:app


To run unit tests we recommend to use another database. For that set the DB_DATABASE environment variable:

DB_DATABASE=zou-test py.test