Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

South 0.8.3 upgrade causes DeserializationError

I have a Django 1.5.5 project that uses South 0.8.2. Everything works great -- including migration using South. When I attempt to upgrade this project to South 0.8.3, I get the following error when I run python manage.py migrate:

(VBEZ)vagrant@vagrant-ubuntu-precise-64:/vagrant$ python manage.py migrate
Running migrations for django_mailbox:
- Nothing to migrate.
 - Loading initial data for django_mailbox.
Installed 3 object(s) from 1 fixture(s)
Running migrations for djcelery:
- Nothing to migrate.
 - Loading initial data for djcelery.
DeserializationError: Problem installing fixture 'initial_data.json': Invalid model identifier: 'sites.site'

What has happened?

Here is my initial_data.json file:

[
  {
    "pk": 1, 
    "model": "sites.site", 
    "fields": {
      "domain": "0.0.0.0:5000", 
      "name": "Project (Development)"
    }
  }, 
  {
    "pk": 2, 
    "model": "sites.site", 
    "fields": {
      "domain": "project-staging.example.com", 
      "name": "Project (Staging)"
    }
  }, 
  {
    "pk": 3, 
    "model": "sites.site", 
    "fields": {
      "domain": "project.example.com", 
      "name": "Project"
    }
  }
]

Here is what a successful migration using South 0.8.2 looks like:

Running migrations for django_mailbox:
- Nothing to migrate.
 - Loading initial data for django_mailbox.
Installed 3 object(s) from 1 fixture(s)
Running migrations for djcelery:
- Nothing to migrate.
 - Loading initial data for djcelery.
Installed 3 object(s) from 1 fixture(s)
Running migrations for taggit:
- Nothing to migrate.
 - Loading initial data for taggit.
Installed 3 object(s) from 1 fixture(s)
Running migrations for eee_core:
- Nothing to migrate.
 - Loading initial data for eee_core.
Installed 3 object(s) from 1 fixture(s)
Running migrations for core:
- Nothing to migrate.
 - Loading initial data for core.
Installed 3 object(s) from 1 fixture(s)

Things I have looked at/tried:

  • django-contrib-sites is in my `INSTALLED_APPS'
  • Migration works fine if the initial_data.json file is removed.
  • If I run migrations individually, they run fine. Example python manage.py migrate myapp.
  • I have submitted a ticket: http://south.aeracode.org/ticket/1324

Thanks.

like image 562
Erik Avatar asked Oct 20 '22 20:10

Erik


1 Answers

Looks like this a known bug in South 0.8.3: http://south.aeracode.org/ticket/1320. Fix is expected in a week or so.

Update: South 0.8.4 fixes this bug.

like image 107
Erik Avatar answered Oct 23 '22 11:10

Erik