Search code examples
djangodjango-syncdb

Django not creating tables for an installed app


My django site was functioning before I installed Lion and had to reinstall everything related to development. Since then, I have deleted and recreated my database, but one of my two installed apps is being ignored in syncdb. Those tables are not present in my database.

This post suggested there might be an import error. I can import the app in question using manage.py shell, so I don't think that's it.

Both apps are definitely installed (verified by debug toolbar). Any other suggestions? I'm relatively new to Django, having been mostly an iOS developer for the past couple of years.


Solution

  • https://docs.djangoproject.com/en/dev/ref/models/options/#app-label

    If a model exists outside of the standard models.py (for instance, if the app’s models are in submodules of myapp.models), the model must define which app it is part of.

    What it doesn't mention is that they also have to be imported somewhere during the model registration phase.