I am new to Django, so i don’t know if the answer is obvious. I created models.py inside a project and when i tried syncDB, it did not create the tables defined in models.py. Only when i create models.py inside an app and after registering the app with INSTALLED_APPS, the tables are getting created on syncDB.
Is this is how Django works? Or am i missing something.
Django only syncs what’s defined in
INSTALLED_APPS. The name is pretty straight-forward. Django’s going to look for at least a module (directory with an__init__.py) with amodels.pyfile inside. So yes, you need an “app”, but that app can be just a directory with just__init__.pyandmodels.pyfiles inside.