FastTask is a toy task tracker app written in FastAPI with Tortoise ORM
To simply run the app, this should be enough:
docker compose up
If major change happened (e.g. dependency added), append --build
flag.
For running using .env, while at fasttask/
run:
python -m app.main
For running with uvicorn directly, while at fasttask/
run:
uvicorn app.main:app --host localhost --port 8080
For hot-reloading mode specify --reload
.
Tip: absolute imports won't work if we start at the directory that is root package or some directory within it. We must run it at root package's parent.
Create:
python -m venv venv
Activate (Windows):
.\venv\Scripts\activate.bat
Activate (*nix)
source ./venv/bin/activate
pip install debugpy fastapi pydantic-settings "uvicorn[standard]" "tortoise-orm[asyncpg]"
pip install -r requirements.txt
pip freeze > requirements.txt