Search code examples
djangodjango-modelsdjango-south

Rename application in django


I had app lets say movies, with some models and initial south migration. Now I want to change its name to resource. So I created empty south data migration and changed all table names to relevant and then renamed app folder, app name in settings.py and all imports. It looks correct. But when I run migration I receive:

django.core.exceptions.ImproperlyConfigured: App with label movies could not be found

But south mark migration as completed. What should I change to correct it?

EDIT:

Should I also rename all occurences of 'movies' in initial migration?

EDIT2: The problem also occurs when I try to migrate over clear tables. Then south try to create tables for app movies and it is already renamed to resource.


Solution

  • I used a hacky solution to solve this one. But I don`t see any other one. I changed initial migration so it creates resource tables not movies ones, and in migration which changes tables names I wrapped commands into

    try..except
    

    block