Skip to content

feat: add compatibility with django-allauth v65.4 #681

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

browniebroke
Copy link

@browniebroke browniebroke commented Feb 24, 2025

  • Prefer the new LOGIN_METHODS when available
  • Fallback to AUTHENTICATION_METHOD. Should keep dj-rest-auth working with older allauth versions
  • Once dj-rest-auth wants to drop support for django-allauth < 65.4:
    • Remove the branches with AUTHENTICATION_METHOD
    • Update the minimum allauth version in setup.py (and docs, if needed)

Fix #679

@sipa-echo-zaoa
Copy link

Hi @iMerica,
Could you please merge this PR?
Getting these warning messages every time a command is run is getting pretty annoying.
Thank you.

@evdutt
Copy link

evdutt commented Jun 26, 2025

@iMerica Can you please take a look at this PR so I can stop getting warnings? Thanks!

In the meantime, I added the following to my settings to suppress this.

import warnings

warnings.filterwarnings(
'ignore',
message='app_settings.AUTHENTICATION_METHOD is deprecated, use: app_settings.LOGIN_METHODS',
category=UserWarning,
module='dj_rest_auth.serializers'
)

@onny
Copy link

onny commented Jul 4, 2025

Trying to use this with django-allauth 65.9 I get this error while running tests

       > ======================================================================
       > ERROR [0.001s]: dj_rest_auth.tests.test_social (unittest.loader._FailedTest.dj_rest_auth.tests.test_social)
       > ----------------------------------------------------------------------
       > ImportError: Failed to import test module: dj_rest_auth.tests.test_social
       > Traceback (most recent call last):
       >   File "/nix/store/sd81bvmch7njdpwx3lkjslixcbj5mivz-python3-3.13.4/lib/python3.13/unittest/loader.py", line 396, in _find_test_path
       >     module = self._get_module_from_name(name)
       >   File "/nix/store/sd81bvmch7njdpwx3lkjslixcbj5mivz-python3-3.13.4/lib/python3.13/unittest/loader.py", line 339, in _get_module_from_name
       >     __import__(name)
       >     ~~~~~~~~~~^^^^^^
       >   File "/build/source/dj_rest_auth/tests/test_social.py", line 5, in <module>
       >     from allauth.socialaccount.providers.facebook.provider import GRAPH_API_URL
       > ImportError: cannot import name 'GRAPH_API_URL' from 'allauth.socialaccount.providers.facebook.provider' (/nix/store/crzcnj72srj6wb0ar5r2w0hcs04jhpsx-python3.13-django-allauth-65.9.0/lib/python3.13/site-packages/allauth/socialaccount/providers/facebook/provider.py)
       >
       >
       > ----------------------------------------------------------------------
       > Ran 59 tests in 68.187s
       >
       > FAILED (errors=1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AUTHENTICATION_METHOD is deprecated as of allauth v65.4
4 participants