Running the app:
uvicorn main:app --reload
# app is the name of the FastAPI instance in main.py
# --reload flag is for auto-reloading the server on code changes
Access parameters from .env
pip install python-dotenv
load_dotenv()
engine = create_async_engine(
# sensitive data
url = os.getenv("DATABASE_URL")
encho = True
)