kloki / seats

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Seats

A swagger schema is available at http://127.0.0.1:8000/schema/ when running dev environment for the rest api.

Adding a group

The add group endpoint is a bit rushed so it doesn't play nice with swagger Here is how to use:

curl -H "Content-Type: application/json" -X POST -d '{"event":1,"guests":["name1","name2"]',"section":1} http://127.0.0.1:8000/api/add-group/

event and section are pk's and section is optional.

Setup

please install docker and docker-compose before continuing. If you dont want to user docker make sure a postgres instance is running on 0.0.0.0:5432.

Development setup

Setup virtualenv

virtualenv env -p python3
source env/bin/activate
pip install -r requirements/production.txt

Start services

make dev_stack

Migrate

python3 seats_api/manage.py migrate

Start dev instance

make runserver

Fixtures

python3 seats_api/manage.py loaddata example_event.json

This will create an event for testing. Will also create a super user with the credentials admin:pass1234

Tests

make test

Will spin up everything in a docker environment. Please make sure there are no conflicting docker images running.

Productioen

make build
make start_prod

if needed run migrations and

docker exec seats_api_1 python3 manage.py migrate

About


Languages

Language:Python 95.8%Language:Makefile 2.5%Language:Shell 1.7%