У меня есть приложение (назовем его MyApp) в проекте Django 1.5. MyApp определяет пользовательскую модель пользователя (MyUser). В проекте используется другое приложение (AnotherApp), которое ссылается на MyUser. MyApp ссылается на поля в AnotherApp.Django south circle dependency
Все работает отлично на моем ноутбуке разработки. Я пытаюсь развернуть мой проект на сервере, и когда я прихожу на этап переноса, MyApp терпит неудачу из-за зависимости с AnotherApp, а AnotherApp терпит неудачу в зависимости от MyApp (я пробовал самостоятельно переносить приложения). Оба отказались от их соответствующих первых миграций (0001)
Running migrations for myapp:
- Migrating forwards to 0017_auto__blah_blah.
> myapp:0001_initial
FATAL ERROR - The following SQL query failed: ALTER TABLE "myapp_mymodel_othermodel" ADD CONSTRAINT "othermodel_id_refs_id_ae052c6d" FOREIGN KEY ("othermodel_id") REFERENCES "anotherapp_othermodel" ("id") DEFERRABLE INITIALLY DEFERRED;
The error was: relation "anotherapp_othermodel" does not exist
Error in migration: myapp:0001_initial
DatabaseError: relation "anotherapp_othermodel" does not exist
Running migrations for anotherapp:
- Migrating forwards to 0008_blah_blah.
> anotherapp:0001_initial
FATAL ERROR - The following SQL query failed: ALTER TABLE "anotherapp_othermodel" ADD CONSTRAINT "creator_id_refs_id_cff6fecf" FOREIGN KEY ("creator_id") REFERENCES "myuser" ("id") DEFERRABLE INITIALLY DEFERRED;
The error was: relation "myuser" does not exist
Error in migration: anotherapp:0001_initial
DatabaseError: relation "myuser" does not exist
Любые идеи?
Существует (закрытый) билет для этой проблемы (http://south.aeracode.org/ticket/390), который имеет хорошее обсуждение темы. –