A WIP Starlite API Implementation.
- Header/cookie parameter example.
- CI?
- Profile
- Profile alternate UUID implementation (https://github.com/MagicStack/py-pgproto/blob/a4178145cd7cc3a44eee20cfc9e8b94a7fed2053/uuid.pyx)
- Gunicorn logconfig ignore sqlalchemy.engine logs
- explicitly include any dirs/files into docker and remove .dockerignore
- add pre-commit (I'll just make as equivalent as possible to the original pre-commit config in this project)
- configure pyupgrade for only --py310-plus
- use the Dockerfile from https://gist.github.com/Goldziher/942f4a027a7fa1e2cafaa35e0333b6dc
- remove black and isort from alembic hooks
- map docker ports to service defaults
- add pylint into tooling
- black and isort settings as per original
- websocket example project with simple front end???
Starlite is a light and flexible ASGI API framework.
There is a known issue when running gunicorn with uvicorn workers, see here.
For convenience an implementation of the workaround (this one) suggested in that gunicorn issue is included in the application source.
To use the included RestartableUvicornWorker
set the GUNICORN_WORKER_CLASS
env var
to app.utils.restartable_worker.RestartableUvicornWorker
.
In production, set the GUNICORN_WORKER_CLASS
env var to uvicorn.workers.UvicornWorker
as advised here.
$ cp .env.example .env
$ docker-compose run --rm app alembic upgrade head
$ docker-compose up --build
http://localhost:8000/schema
$ docker-compose run --rm app scripts/tests
$ docker-compose run --rm app black .
$ docker-compose run --rm app isort .
$ docker-compose run --rm app poetry add <dependency>
$ docker-compose run --rm app poetry add <dependency> --dev
$ docker-compose build
$ docker-compose up -d db
$ docker-compose run --rm app alembic revision --autogenerate -m "revision description"
May have issue with permissions after having docker generate the revision file, to fix:
$ sudo chown <user> ./alembic/versions/<filename>.py
$ docker-compose run --rm app alembic upgrade head