I already have an existing Database that has a lot of tables and a lot of data in MySQL
. I intend to create a Flask
app and use sqlalchemy along with it. Now I asked out on irc and looked around on google and tried the following ideas:
First I used sqlacodegen to generate the models from my DB
. But then I was confused about it a little and looked some more. And I found this.
This looked like an elegant solution.
So Second, I rewrote my models.py
according to the solution there and now I am even more confused. I am looking for the best approach to build this flask app along with the already existing DB.
I looked into the flask documentation but didnt really get any help for a project with an already existing db. There is a lot of good stuff for creating something from scratch, creating the db and all. But I am really confused.
Please Note that its my first day with Flask
, but I have experience with Django
, so the basic concepts are not a hurdle. I need some guidance in choosing the best approach for this usecase. A detailed explanation would be greatly appreciated. By detailed I definitely do not expect someone to write all the code and spoon feed me on this, but just enough to get me started, that is integrate this db seamlessly into flask
via sqlalchemy
. Note my DB is in MySQL
.