2👍
✅
Daniel Roseman is correct, when running manage.py startapp appname
, Django will automatically create a directory structure with a separate models.py
per app like:
appname/
models.py
As well as being convention (if other Django developers come to look at your code, this is where they will expect to find your models) it also allows people to create reusable apps
e.g. by simply copying the appname
directory I have all the URL patterns (if any), views, models, forms, tests and everything else, rather than having to pull out all the files from a large separate directory.
👤Ewan
2👍
The first option is correct in Django each app has her own models.py or models directory.
Source:stackexchange.com