Development environment

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


To run Postgres, we recommend using 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 using Docker again:

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


To run Meilisearch, we recommend using Docker again:

sudo docker pull getmeili/meilisearch:v1.8.3
sudo docker run -it --rm \
    --name meilisearch \
    -p 7700:7700 \
    -e MEILI_ENV='development' \
    -e MEILI_MASTER_KEY='meilimasterkey' \
    -v $(pwd)/meili_data:/meili_data \
    -d getmeili/meilisearch:v1.5


For video operations, FFMPEG is required. For that, 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:

PREVIEW_FOLDER=$PWD/previews DEBUG=1 MAIL_DEBUG=1 FLASK_DEBUG=1 INDEXER_KEY=meilimasterkey python zou/

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

Update database

In case of adding/removing attributes of models, you must generate the DB update file:

python zou/ migrate-db

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 using another database.

Create a testing database

In the CLI of the hosting, the PostgreSQL DB executes the following: If Docker, connect with: docker exec -it postgres bash

sudo su -l postgres
psql -c 'create database zoutest;' -U postgres

Run the tests

In your zou environment workon zou, execute the tests with the DB_DATABASE environment variable:

DB_DATABASE=zoutest py.test

If you want to run a specific test (you can list several):

DB_DATABASE=zoutest py.test tests/models/

Debug email sending

If you set properly the MAIL_DEBUG=1 flag, the body of each sent email is displayed in the console.