[Fixed]-Django: Is it possible to create a model without an app?

12đź‘Ť

âś…

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 a models.py file inside. So yes, you need an “app”, but that app can be just a directory with just __init__.py and models.py files inside.

👤Chris Pratt

1đź‘Ť

from the documentation:

syncdb Creates the database tables for all apps in INSTALLED_APPS whose tables have not already been created.

👤Dmitry B.

1đź‘Ť

Yup — I think models can only live in an app (pretty much everything in Django has to be an app).

The following section of the docs implies it, even if it doesn’t quite say it directly:

And this section of the tutorial sort of explains apps:

👤Paul D. Waite

Leave a comment