[![Build Status](https://travis-ci.org/Pand-Aid /pandaid-api.svg?branch=master)](https://travis-ci.org/Pand-Aid /pandaid-api)
REST API backend for Pand-Aid pandemic response app.
Check out the project's Main README for more information.
All commands in bash regardless of operating system unless otherwise noted
$ brew install docker-compose
The first time you work on this, build the docker image:
docker-compose build
Then start it with
docker-compose up
Then get a shell in the docker container and create a superuser
$ docker exec -ti pandaid-api_web_1 /bin/bash
:/code# python manage.py createsuperuser --email admin@example.com --username admin
The first time you work on this, build the docker image:
docker-compose build
Then start it with
docker-compose up
Then get a shell in the docker container and create a superuser
$ winpty docker exec -it pandaid-api_web_1 //bin/sh
:/code# python manage.py createsuperuser --email admin@example.com --username admin
You can get an authentication token by sending a POST request to http://localhost:8000/api-token-auth/
with the superuser credentials in a formdata labeled username
and password
.
For example, you can send the POST request as a cURL request:
curl --location --request POST 'localhost:8000/api-token-auth/' \
--header 'Content-Type: multipart/form-data' \
--form 'username=<username>' \
--form 'password=<password>'
or via an app such as Postman.
Start the dev server for local development:
docker-compose up
(hide server logs by adding the -d
flag)
Run a command inside the docker container:
docker-compose run --rm web [command]
Check out our Contribution Guidelines if you are interested in helping with this project
Notice an issue in our code or documentation? Is there a new feature you would like to see implemented?
As a first step checkout our How To File an Issue guide