I’m starting a project and i’ve decided to use Django.
My question is regarding to the creation of the database. I’ve read the tutorial and some books and those always start creating the models, and then synchronizing the DataBase. I’ve to say, that’s a little weird for me. I’ve always started with the DB, defining the schema, and after that creating my DB Abstractions (models, entities, etc).
I’ve check some external-pluggable apps and those use that “model first” practice too.
I can see some advantages for the “model-first” approach, like portability, re-deployment, etc.
But i also see some disadvantages: how to create indexes, the kind of index, triggers, views, SPs, etc.
So, How do you start a real life project?
Triggers, views, and stored procedures aren’t really a part of the Django world. It can be made to use them, but it’s painful and unnecessary. Django’s developers take the view that business logic belongs in Python, not in your database.
As for indexes, you can create them along with your models (with things like
db_indexandunique_together, or you can add them later via database migrations using something like South.