Skip to content

fcfangcc/fastapi-async-template

Repository files navigation

fastapi-async-template

A Python Async Project Template With FastAPI and SQLAlchemy (reference full-stack-fastapi-postgresql)

How to use

# pip install cookiecutter
# cookiecutter https://github.com/fcfangcc/fastapi-async-template.git

Create a env configuration

# touch .env

SECRET_KEY = "secret_key"
FIRST_SUPERUSER = "[email protected]"
FIRST_SUPERUSER_PASSWORD = "password"
SQLALCHEMY_DATABASE_URI = "mysql+aiomysql://user:password@mysql-host/dbname?charset=utf8mb4"

Initialize database

# bash ./scripts/init_db.sh

Start develop web service

# poetry install -E mysql --no-dev
# poetry run python manager.py db init
# poetry run python manager.py runserver --port 8000

Deploy with dockert

# docker build -f dockerfiles/Dockerfile  -t my-app .
# docker run --name mycontainer -p 80:80 my-app

Dependencies

About

Async Project Template With FastAPI and SQLAlchemy

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published