Example API with Django and Django Ninja.
API Docs: https://messg-api.herokuapp.com/api/docs
Available endpoints:
- /api/messages/ GET - List all added messages
- /api/messages/{message_id}/ GET - Retrive message, increments counter
- /api/messages/{message_id}/ POST* - Add message
- /api/messages/{message_id}/ PUT* - Update message, restet counter
- /api/messages/{message_id}/ DELETE* - Delete message
* API key required
SQLite database and Django development server.
Recomended poetry for local development.
You will need to add API key by django shell or manually in database.
- Go to project root directory
- Install and set environment:
$ poetry install $ poetry shell $ cd messgapi
- Run tests:
$ python manage.py tests
- Create a database:
$ python manage.py migrate
- Run development server:
$ python manage.py runserver
- The server should be running on: localhost:8000
- Go to project root directory
- Build images:
$ docker-compose build
- Run containers:
$ docker-compose up -d
- Create a database:
$ docker exec messg-api python manage.py migrate
- The server should be running on: localhost:8000
Heroku, PostgreSQL and gunicorn.
Build manifest in heroku.yml.