Development

The API is built with Python using Django and Django Rest Framework.

Dev Environment Overview

Quickstart

Clone the project and install the dependencies:

$ git clone git@github.com:knowmetools/km-api
$ cd km-api
$ pipenv install --dev

Local Dev Server

The development server can be run using the following command:

$ pipenv run km_api/manage.py migrate
$ pipenv run km_api/manage.py runserver

Running Tests

Tests are run with pytest. To run the tests, make sure the requirements are installed and run the tests:

$ pipenv install --dev
$ pipenv run pytest km_api/

Building Docs

We use sphinx for building documentation, and the docs are automatically published using ReadTheDocs. If you want to build the docs locally, install the requirements and run the build command:

$ pipenv install -r requirements/docs.txt
$ cd docs
$ pipenv run make html