Create .env file in root directory :
DATABASE_USER=app
DATABASE_PASSWORD=password
DATABASE_URL=postgres-app
DATABASE_NAME=app
JWT_ACCESS_TOKEN_KEY=<random 64 char>
JWT_REFRESH_TOKEN_KEY=<random 64 char>
Use at least python 3.10.
python3 -m venv venv
source venv/bin/activatepip3 install -r requirements/dev.txt # or prod.txtInstall PostgreSQL here.
And then create a database/user :
CREATE DATABASE app
CREATE USER app WITH PASSWORD 'password';If there is no versions in migrations/versions folder, execute this command :
# Generate version file
alembic revision --autogenerate -m "init"To apply your migration file to the database :
alembic upgrade headIn case of error : FAILED: Can't locate revision identified by '747e6da84866' you might delete entry in alembic_version table :
$ docker exec -it postgres-app psql -U app
DELETE FROM alembic_version;python3 main.py