CircularDependencyError with AUTH_USER_MODEL set
|Reported by:||brian||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I am trying to get django-guardian working with Django 1.7, and I keep getting this error:
$ python setup.py test ... django.db.migrations.graph.CircularDependencyError: [('admin', u'0001_initial'), ('testapp', u'0001_initial'), (u'admin', u'0001_initial')]
As far as I can tell, this is absolutely correct, there is a circular loop, only I don't know what to do about it. testapp/models.py contains:
from django.contrib.auth.models import AbstractUser class CustomUser(AbstractUser, GuardianUserMixin): custom_id = models.AutoField(primary_key=True)
AUTH_USER_MODEL = "testapp.CustomUser"
This results in a migration that contains:
dependencies = [ ('auth', '0001_initial'), migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('admin', '0001_initial'), ]
If I understand correctly, testapp depends on auth because it uses AbstractUser which requires Group.
I am not sure I understand why the auth app depends on testapp.
Very experimental source with some other Django 1.7 fixes is available here:
Change History (10)
comment:1 Changed 6 months ago by Markush2010
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset