I am new with Django. I am using DRF. I was trying to integrate social authentication using dj-rest-framework and django-allauth, but I currently have an app called account, so it gives a naming conflict with allauth.account
.
I managed to fix this by following this solution. It is a known problem with allauth.account
and changing one of the apps label will fix the confilct.
Here comes the second problem. After I configured the URL, it gave an error
ProgrammingError
"Table '<project-name>.socialaccount_socialapp' doesn't exist"
So, I thought that maybe making migrations will fix the issue. When I try making migrations, it gave some different errors based on the changes that I made, but none of the solutions seems to work.
When I changed the label name of the AllAuth Account as described on the solution mentioned above and then trying to make the migrations python manage.py makemigrations
gives this error:
CommandError: Conflicting migrations detected; multiple leaf nodes in the migration graph: (0001_initial, 0002_email_max_length in allauth_account).
To fix them run 'python manage.py makemigrations --merge'
and then running: python manage.py makemigrations --merge
gives
ValueError: Could not find common ancestor of ['0001_initial', '0002_email_max_length']
If I try changing my account app label instead of the allauth account label, some different errors occure.
django.db.migrations.exceptions.NodeNotFoundError: Migration myaccount.0004_auto_20210406_1505 dependencies reference nonexistent parent node ('account', '0003_something')
So the app name on the migration is still account
instead of myaccount
. Running python manage.py makemigrations
gives the same error.
Manually modifying the migrations dependencies, so changing account
to myaccount
will fix this error, but then when trying to make the migrations again, a lot of other errors occure:
ValueError: The field myaccount was declared with a lazy reference to 'account', but app 'account' doesn't provide model 'team'.
The field <app.something> was declared with a lazy reference to 'account', but app 'account' doesn't provide model 'team'.
The field <app.something> was declared with a lazy reference to 'account', but app 'account' doesn't provide model 'team'.
The field <app.something> was declared with a lazy reference to 'account', but app 'account' doesn't provide model 'team'.
The field <app.something> was declared with a lazy reference to 'account', but app 'account' doesn't provide model 'team'.