python-rest-api-example

codecov Tests Linters Deploy

Dependencies

  • Python 3.9
  • Poetry

pre-commit

Install

pre-commit install

pre-commit install -t pre-push

Run locally

pre-commit run --all-files

Migrations

Using alembic

alembic init migrations

Create script

alembic revision -m "SCRIPT DESCRIPTION"

Test

Run tests using pytest

pytest tests/

Docker

docker build -t python-rest-api-example:0.1 .
docker run -p 5000:5000 --env-file .env python-rest-api-example:0.1

Manual Deploy to Heroku

heroku container:push web -a <HEROKU-APP-NAME>
heroku container:release web -a <HEROKU-APP-NAME>

Resources