python - How to approach Django project starting with database schema? -


every django tutorial/book i've seen approaches django projects going characterize ad-hoc database design method. project ends-up being bunch of little apps, each it's own models, view, etc.

i trying locate resource covers how structure django project when do, in fact, start traditional db design process.

for example, let's starting point:

enter image description here

and document describing it:

lead database guide

how 1 approach various django apps access single "global" (bad word) db model covers entire schema rather bunch of models spread across bunch of apps?

are there resources (books, pdf's, tutorials) cover approach rather piece-meal approach commonly seen?

a corollary question might be: there a, perhaps automated, way go sql (or mysql workbench) schema definition equivalent django orm?

you can use inspectdb command generate models.py database: http://docs.djangoproject.com/en/dev/ref/django-admin/#inspectdb

then, can treat models single app, , add more features/tables new apps in future.


Comments

Popular posts from this blog

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

python - How to remove the Xframe Options header in django? -