21๐
โ
I ran into the same problem after adding a model for an app that was already installed, but forgetting to creating the initial migration. OP hid the answer in the comments so here are explicit steps:
$ mkdir myapp/migrations
$ touch myapp/migrations/__init__.py
After this I got a new error when trying to run python manage.py test
psycopg2.errors.InvalidCursorName: cursor "_django_curs_140073820227328_58" does not exist
One more step was needed:
$ python manage.py makemigrations
And then tests ran fine.
๐คTom McCarty
4๐
I deleted the sqllite3 database
then I ran
$ python manage.py migrate
then
$ python manage.py migrate --run-syncdb
๐คGenie
- Uwsgi segmentation fault when serving a django application
- How to upgrade Django on ubuntu?
- Tastypie Negation Filter
- How to make follower-following system with django model
- Subclassing Django ModelForms
2๐
The issue is that one of your apps is calling or referencing a non-existent model. The model may be in your code but no migration has been run for it.
Fix: Make sure all your apps have a migration package (i.e. migration folder with init.py file), then run makemigrations and migrate.
๐คFemolak
- Django template indentation guideline
- Is exposing a session's CSRF-protection token safe?
- Use of unicode in Django
- Accessing django project in LAN systems
Source:stackexchange.com