Using Fastapi
> pip install -r requirements.txt
Create .evn
file and add DATABASE_URL
SECRET_KEY
ACCESS_TOKEN_EXPIRE_MINUTES
ALGORITHM
Mask
DATABASE_URL="{username}:{password}@{hostname}:{port}/{db_name}"
Example:
DATABASE_URL="postgres:0030@localhost:5432/gamefor" # your db url
SECRET_KEY="dfj;alsjiur20r0jsdjfsdlkmflsdjoid" # any symbols what you wont
ACCESS_TOKEN_EXPIRE_MINUTES=60 # how many do you wont use token
ALGORITHM="HS256" # Use this by default
You can run using Pycharm config or with command on terminal
uvicorn app.main:app --host=localhost --port=8080
Inti DB for starting migrations
aerich init-db
For migrating changes
aerich migrate --name TEXT Migrate name. [default: update]
Upgrade to specified version.
aerich upgrade