LaurenceWarne / django-test

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A Django Example Project

codecov

Running

First clone the repo:

git clone https://github.com/LaurenceWarne/django-test
cd django-test

From here you can:

docker build . -t django-test
docker run --rm -d -p 8000:8000 django-test

And skip to the last step. Alternatively, ensure you have a Python 3.9 and tox installation on your system and create the necessary migrations:

tox -e py39 python manage.py makemigrations

Run the migrations:

tox -e py39 python manage.py migrate

Start a dev server:

tox -e py39 python manage.py runserver

Hit it!

curl -X POST http://127.0.0.1:8000/create-candidate -H "Content-Type: application/json" --data '{"ref":"12345678","name":"dave"}'
curl -X POST http://127.0.0.1:8000/create-score -H "Content-Type: application/json" --data '{"candidate_ref":"12345678","score":"9"}'
curl -X GET http://127.0.0.1:8000/get-candidate/12345678

Testing

You can run the tests via:

tox -e py39

About


Languages

Language:Python 98.5%Language:Dockerfile 1.5%