Skip to content

When using allauth-2fa without socialauth installed it fails with error #203

Open
@darklow

Description

Installed apps have following apps installed:

# django-allauth==65.3.1
# django-allauth-2fa==0.11.1

INSTALLED_APPS = [
...
    'allauth',
    'allauth.account',
    'allauth_2fa',
]

When importing OTPAdapter it throws following exception.

./manage.py shell
Python 3.11.5 (main, Nov 21 2024, 22:26:00) [Clang 16.0.0 (clang-1600.0.26.4)] on darwin

>>> from allauth_2fa.adapter import OTPAdapter

/Users/user/project/.venv/lib/python3.11/site-packages/allauth/exceptions.py:9: UserWarning: allauth.exceptions is deprecated, use allauth.core.exceptions
  warnings.warn("allauth.exceptions is deprecated, use allauth.core.exceptions")
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/Users/user/project/.venv/lib/python3.11/site-packages/allauth_2fa/adapter.py", line 7, in <module>
    from allauth.socialaccount.models import SocialLogin
  File "/Users/user/project/.venv/lib/python3.11/site-packages/allauth/socialaccount/models.py", line 26, in <module>
    raise ImproperlyConfigured(
django.core.exceptions.ImproperlyConfigured: allauth.socialaccount not installed, yet its models are imported.

But socialauth should be optional unless it is really required.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions