I have 2 django apps i.e. main and authtools. When I run
python manage.py migrate
, I get a CircularDependencyError:
raise CircularDependencyError(", ".join("%s.%s" % n for n in cycle))
django.db.migrations.graph.CircularDependencyError: main.0001_initial, authtools.0001_initial
In my setting file I have the AUTH_USER_MODEL defined as such:AUTH_USER_MODEL = 'authtools.User'
. The migration files created look like this:
For the authtools app, it shows dependancies as:
dependencies = [
('main', '__first__'),
('auth', '0001_initial'),
]
And for the main app, the depandancies are shown as:
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
What could be wrong?
I think you need to follow this ticket of django code base: https://code.djangoproject.com/ticket/22932
According to them your migration code should look like either this (https://code.djangoproject.com/attachment/ticket/22932/team.0001_initial.py.diff) or(https://code.djangoproject.com/attachment/ticket/22932/team.0002_auto_20140704_1453.py):