Making Flask connection to existing Postgres tables based on Django models

Question:

I am developing a Flask app that queries on an existing Postgres DB. This DB had been created with Django models. Do i need to reverse engineer so my models would be compatible with SQLAlchemy or will that already be. Is raw queries the way to go? I don’t want to create new DBs just query and update some values in the existing ones, that had been created in Postgres using my django models.

Asked By: Apoorva Srivastava

||

Answers:

Go check out sqlalchemy’s AMAZING automap feature: http://docs.sqlalchemy.org/en/latest/orm/extensions/automap.html

Used it once in my personal project for similar purpose, it works great.

Answered By: piglei
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.