March 2019
Beginner
490 pages
12h 40m
English
For the most common web applications, it is generally recommended that you use a Flask extension such as flask-sqlalchemy. To install the package for working with SQLAlchemy from Flask, just execute the following command:
pip install flask-sqlalchemy
Once we have our Flask application created, to integrate it with sqlalchemy, we would have to create a configuration file with the database path, from which the SQLAlchemy object is created to manage the database.
In this example, we will use a SQLite database to simplify the configuration without having a database server.
We can add the database configuration in the config.py file inside the flask_sqlalchemy folder:
#!/usr/local/bin/python3import osDEBUG = TrueSQLALCHEMY_DATABASE_URI ...
Read now
Unlock full access