Skip to content

praekeltfoundation/flow-results

Repository files navigation

Flow Results

An implementation of the flow results API

Usage

Have a look at the API specification documentation for documentation of the API endpoints.

Users, authentication tokens, and permissions can be managed through the django admin page, available at /admin/. To create the first admin user, run python manage.py createsuperuser.

There is a health check endpoint available at /health/, and a prometheus metrics endpoint available at /metrics

Running in Production

There is a docker image that can be used to easily run this service. It uses the following environment variables for configuration:

Variable Description
SECRET_KEY The django secret key, set to a long, random sequence of characters
DATABASE_URL Where to find the database. Set to postgresql://host:port/db for a postgresql database
ALLOWED_HOSTS Comma separated list of hostnames for this service, eg. host1.example.org,host2.example.org

See also this README for more configuration options for tuning the config

Development

Requires Python 3.7 or greater

Install dependencies:

pip install -e .[dev]

Create DB

createdb flow_results

Auto format and run tests:

./format_and_test.sh

Run dev server:

python manage.py migrate
python manage.py runserver