Multiple Database in Flask

Pham Ngoc Quy
1 min readNov 26, 2019

How can we use multiple database in flask.

Flask-SQLAlchemy can easily connect to multiple databases with binds

Example Configuration

Define multiple database uri

Binds table to each other database: We need define name of table for each database

binds “Table1” to database “db2_name”

Flask init multiple database: flask db init — multidb

--

--