SQLAlchemy is a Python SQL toolkit and provides an ORM that gives the flexibility and power of SQL with the feel of Python's object-oriented nature. In this recipe, we will understand how to create a SQLAlchemy database instance that can be used to perform any database operation that shall be covered in future recipes.
Creating an SQLAlchemy DB instance
Getting ready
Flask-SQLAlchemy is the extension that provides the SQLAlchemy interface for Flask.
This extension can simply be installed by using pip as follows:
$ pip3 install flask-sqlalchemy
The first thing to keep in mind with Flask-SQLAlchemy is the application configuration parameter that tells SQLAlchemy about the location of the database to be used:
app.config...