Question

I have a model which I managed to migrate on two different computers without a problem. However on my server I'm getting the following error:

Error in migration: some_app:0002_auto__some_migration

AttributeError: 'DatabaseOperations' object has no attribute 'shorten_name'

Inspecting the migration file I see a line:

    m2m_table_name = db.shorten_name(u'some_app_some_class_some_attribute')

which could be the culprit. (there are a few lines which use this shorten_name. I'm not sure how to solve this.

The virtual environment on my server has South 0.7.6, Django 1.5 (and a Postgis enabled postgres)

Was it helpful?

Solution

The error originates from a version conflict. You migration might have been created with a later version of South (probably in your dev environment) and your production version runs on a earlier version.

Compare the version numbers of the South installations with

pip freeze

and see which South version is listed in both environments.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top