Skip to content

cid-harvard/atlas-subnational-api

Repository files navigation

Subnational API

The API backend for subnational atlas projects at Harvard CID. It's written in python and flask.

Doc build status Circle CI test build

Documentation

For more information on how to access the API and other details, check the documentation.

Usage

Run make dev to run the dev server. It'll install all the dependencies if it has to.

For production, you're looking for runserver.py. The app variable has what you want. Alternatively, the create_app factory could also be used.

Command What it does
`make dev` Run the flask test server in debug mode.
`make test` run tests with coverage
`make dummy` Generates some dummy data and dumps ids.
`make shell` run an ipython shell where you can play around with objects. The variables `app`, `db` and `models` come preloaded.
`make docs` Builds pretty docs and pops open a browser window
`make clean` Clean up all the generated gunk

Configuration

The /conf/ directory contains configuration files. dev.py is included by default. You pass the CHASSIS_CONFIG="path/to/config.py" environment variable to pick a settings file. It's this way to make sure no one accidentally loads the dev config in production.