title: How to build a flask application around an already existing database?
body: <p>I already have an existing Database that has a lot of tables and a lot of data in <code>MySQL</code>. I intend to create a <code>Flask</code> app and use sqlalchemy along with it. Now I asked out on irc and looked around on google and tried the following ideas:</p>
  
  <p><strong>First</strong> I used <a href="https://pypi.python.org/pypi/sqlacodegen" rel="noreferrer">sqlacodegen</a> to generate the models from my <code>DB</code>. But then I was confused about it a little and looked some more. And I found <a href="http://flask.pocoo.org/mailinglist/archive/2012/5/23/flask-sqlalchemy-with-pre-existing-database/#9974419419ee1960c88c98689f6aee9d" rel="noreferrer">this</a>.</p>
  
  <p>This looked like an elegant solution.</p>
  
  <p>So <strong>Second</strong>, I rewrote my <code>models.py</code> 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. </p>
  
  <p>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.</p>
  
  <p>Please Note that its my first day with <code>Flask</code>, but I have experience with <code>Django</code>, 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 <code>flask</code> via <code>sqlalchemy</code>. Note my DB is in <code>MySQL</code>.</p>