iMerica / dj-rest-auth

Authentication for Django Rest Framework
https://dj-rest-auth.readthedocs.io/en/latest/index.html
MIT License
1.63k stars 304 forks source link

Error: "allauth needs to be added to INSTALLED_APPS" after upgrading to django-allauth v0.55.0 #534

Closed brandon-kong closed 10 months ago

brandon-kong commented 11 months ago

Due to a backwards-incompatible change in django-allauth's new v0.55.0, dj_rest_auth does not work with the newest version of allauth. django-allauth's v0.55.0 does NOT have a function "email_address_exists" in allauth/utils.py which is what is causing dj_rest_auth to throw an error in the first place.

How I reproduced:

  1. In my Django project, I installed the latest versions of both allauth and dj-rest-auth with pip install django-allauth dj-rest-auth.
  2. Add the appropriate apps inside INSTALLED_APPS. For reference, I added this to mine:
    
    [
    ...
    'django.contrib.sites',
    'allauth',
    'allauth.account',
    'allauth.socialaccount',
    'allauth.socialaccount.providers.google',

'dj_rest_auth', 'dj_rest_auth.registration', ... ]

3. In one of my apps' `views.py`, I imported `from dj_rest_auth.registration.views import SocialLoginView`.
4. After running `py manage.py makemigrations` or `py manage.py runserver`, etc... I received 
```bash
ImportError: allauth needs to be added to INSTALLED_APPS

I tried:

The error comes from: dj_rest_auth/registration/serializers.py

The expected output should be an errorless migration, but instead I cannot interact with any parts of my application

I created a minimal Django project with the same configurations and pip package versions that I tested above: https://github.com/brandon-kong/dj_rest_auth_issue

jalalsadeghi commented 11 months ago

You need to change your requirements.

django-allauth>=0.24.1<0.55.0

or

pip install django-allauth==0.54.0