How to build a Flask application around an already existing database
Showing how to feed a Flask application with an existing database
There are several tutorials on how to build Flask apps from the ground up. What if we already have a database from another application and we are only interested in utilizing its data?
An example of such requirement is this stackoverflow thread and we shall be adapting this answer. In such a case, we need not worry about recreating the table columns what we just have to declare the needed table(s) names(s) and we will be good to go.
For the purpose of this 1 minute showcase, I have come up with a small and simplified version of a typical blog database shown below.