Custom Search

SUBSCRIBE

SUBSCRIBE : 300 + Free Video Tutorials Programming (Python, golang, Julia), DevOps

Thursday, August 21, 2014

Django South KeyError: "The model 'contenttype' from the app 'contenttypes' is not available in this migration."

1)
#./manage.py migrate app_settings option_to_add_userbookstatus

Running migrations for app_settings:
 - Migrating forwards to option_to_add_userbookstatus.
 > app_settings:option_to_add_userbookstatus
==== In forwards ====
Error in migration: app_settings:option_to_add_userbookstatus
KeyError: "The model 'contenttype' from the app 'contenttypes' is not available in this migration."

2)
Fix
=====
Add following code in migration script file "option_to_add_userbookstatus.py"

    models = {

        u'contenttypes.contenttype': {
            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
        }
    }

No comments:

Post a Comment