Flask 3 · Blueprints, database and CORS
Add SQLAlchemy
Install the extension and bind it to the app.
pip install flask-sqlalchemy
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///app.db"
db.init_app(app)
Official Flask 3 documentation
More blueprints, database and cors commands
All blueprints, database and cors commands · Flask 3 cheatsheet