Example oauth with fast-api
Install Poetry
poetry install
Run server with:
poetry run uvicorn oauth_app.main:app --reload
Available at: http://localhost:8000/
Visit http://localhost:8000/docs#/
Start the database with:
docker-compose up
To initialize the database with migrations and a superuser run:
python run_init_db.py
-
If changes were made to existing models:
- Create a new revision with:
alembic revision --autogenerate -m "Updated model"
- Create a new revision with:
-
If a new model was added:
- Import it into
oauth_app.app.database.base
- Create a new revision with:
alembic revision --autogenerate -m "New model"
- Import it into
Commit the new revisions to the database with:
alembic upgrade head
Must have docker
and docker-compose
installed
Run tests with:
pytest -s -v