I had this same problem, and resolved it by invoking python manage.py makemigrations
specifically for the corsheaders
app:
$ python manage.py makemigrations corsheaders
$ python manage.py migrate
I think what happened in my case was that, after an upgrade from Django 1.8 to 1.9, the initial migration was never applied when I updated my DB.
I tracked it down by noticing that the corsheaders
app was not listed in the Apply all migrations
output of python manage.py migrate
:
$ python manage.py migrate
Operations to perform:
Apply all migrations: sessions, admin, xyz, auth, contenttypes
Running migrations:
No migrations to apply.
Yet running a manual migration for corsheaders
actually creates the initial migration:
$ python manage.py makemigrations corsheaders
Migrations for 'corsheaders':
0001_initial.py:
- Create model CorsModel
After having done that, a migrate
does show corsheaders
in the output, and successfully applies the migration as expected:
$ python manage.py migrate
Operations to perform:
Apply all migrations: corsheaders, sessions, admin, xyz, auth, contenttypes
Running migrations:
Rendering model states... DONE
Applying corsheaders.0001_initial... OK