django-rest-auth
django-rest-auth copied to clipboard
User delete fails if allauth.socialaccount is not in INSTALLED_APPS
This looks like a re-occurrence of #71 I have a users Viewset which has a delete method (Nothing fancy, just added rest_framework.mixins.DestroyModelMixin) When I try to delete, the server responds with this error:
no such table: allauth_socialaccount
Request Method: DELETE
Request URL: http://localhost:8000/users/8/
Django Version: 1.11.7
Python Version: 2.7.14
Server time: Tue, 20 Feb 2018 06:31:44 +0000
Installed Applications:
['django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
'rest_auth',
'django.contrib.sites',
'allauth',
'allauth.account',
'rest_auth.registration',
'api',
'rest_framework_swagger',
'corsheaders',
'dynamic_rest']
However, if I add allauth.socialaccount and remake and apply migrations, everything works fine
It looks like the fix in #107 is no longer present. Moreover, applying it to today's code doesn't seem to solve the problem.
If anyone isn't working on this issue I'd like to take it up. Is there any one here who'd like to provide me some guidelines as to how I should tackle this problem?
I'm also running into the same issue.
After adding 'allauth.socialaccount' to my INSTALLED_APS and running migrations, the problem is gone.
rest_auth's documentation lists allauth.socialaccount as optional, but django-allauth says it is required, so maybe that's the issue?
Sure you can install the app as a workaround, but it's cluttering and confusing to have four empty database tables that we're not using at all. I wonder why socialaccount is required, social login seems pretty darn optional as features go :/
I was using drf-auth and got errors deleting a user too.
Solution by @RikSchoonbeek worked for me.
Adding 'allauth.socialaccount',
corrected the issue.
(https://django-allauth.readthedocs.io/en/latest/installation.html)
INSTALLED_APPS = [
...
'django.contrib.sites',
'allauth',
'allauth.account',
'allauth.socialaccount', # Added this
'rest_auth.registration',
...
]
Once you include 'allauth.socialaccount' in your installed_apps the problem should be gone. Make sure to make migrations and migrate
I also found this confusing in 2020.