2 ms·
As I noted in my other reply, the two projects take different approaches, which are suited to different styles of development. SQLAlchemy puts emphasis on the
by ubernostrum 17y ago
As I noted in my other reply, the two projects take different approaches, which are suited to different styles of development.
SQLAlchemy puts emphasis on the "SQL". It wants to expose every capability of your database and every feature of its SQL dialect, and is heavily oriented around thinking in SQL first and then working your way back to live objects in code.
Django puts emphasis on the "object" side of object-relational mapping; it doesn't aim to be a comprehensive API to your database (since you can just write SQL for that), and moves practically all of the design and interaction up into the Python code layer, then working your way down to the DB as needed.
Or, more succinctly:
* SQLAlchemy: "I have a database and want to interact with it through Python objects".
* Django: "I have Python objects, and would like to use a database as a store for them."
Neither one is objectively the "right" or "wrong" way to approach this, IMHO.