Of course, SQLAlchemy and the Flask extension are a database abstraction layer and object relational mapper, respectively. It's a fancy way of saying to use the Python object for a database. To make things simple, we will use SQLite as the database, which is a flat file that acts as a self-contained SQL database. We will look at the content of chapter9_db_1.py as an example of using Flask-SQLAlchemy to create a network database and insert a table entry into the database.
To begin with, we will create a Flask application and load the configuration for SQLAlchemy, such as the database path and name, then create the SQLAlchemy object by passing the application to it:
from flask import Flaskfrom flask_sqlalchemy import SQLAlchemy ...