[Django]-How to use Django South with third party apps loaded from egg?

4👍

The answer finally was to do this in settings.py:

SOUTH_MIGRATION_MODULES = {
    'books': 'myproject.app_name.migrations',
}

But, since I was using site.addsitedir(path('apps')) to add the directory where my apps reside to the python path, I didn’t need the myproject part. But of course, as soon as you remove the myproject part, South again uses the egg-installed version of the app. My solution was therefore simply to create a new directory in my project, called migrations (remember the __init__.py), and changed settings.py like so:

SOUTH_MIGRATION_MODULES = {
    'books': 'myproject.migrations.app_name.migrations',
}

The migrations directory can now keep any third-party app migrations.

Leave a comment