No module named 'allauth.socialaccount.providers.keycloak'

630 views
Skip to first unread message

Arno Franken

unread,
May 21, 2020, 8:11:49 AM5/21/20
to Django users
Hello,

I have a Django app that uses Allauth (Signin through Office365 account). That works all fine. Now I wanted to test with the Keycloak provider, but for some reason it says: "ModuleNotFoundError: No module named 'allauth.socialaccount.providers.keycloak'" It is very strange, it seems that the keycloak provider is not availbale in the allauth package version 0.41.0, although it should be present according to the docs: https://django-allauth.readthedocs.io/en/latest/installation.html

FULL ERROR TRACE

File "/Users/arnofranken/CyberCloud/venv/lib/python3.7/site-packages/django/apps/config.py", line 118, in create
cls = getattr(mod, cls_name)
AttributeError: module 'allauth.socialaccount.providers' has no attribute 'keycloak'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "manage.py", line 21, in <module>
main()
File "manage.py", line 17, in main
execute_from_command_line(sys.argv)
File "/Users/arnofranken/CyberCloud/venv/lib/python3.7/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
utility.execute()
File "/Users/arnofranken/CyberCloud/venv/lib/python3.7/site-packages/django/core/management/__init__.py", line 377, in execute
django.setup()
File "/Users/arnofranken/CyberCloud/venv/lib/python3.7/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Users/arnofranken/CyberCloud/venv/lib/python3.7/site-packages/django/apps/registry.py", line 91, in populate
app_config = AppConfig.create(entry)
File "/Users/arnofranken/CyberCloud/venv/lib/python3.7/site-packages/django/apps/config.py", line 136, in create
import_module(entry)
File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'allauth.socialaccount.providers.keycloak'


INSTALLED APPS

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
'django_extensions',
'rest_framework',
'sslserver',
'allauth',
'allauth.account',
'allauth.socialaccount',
'allauth.socialaccount.providers.microsoft',
'allauth.socialaccount.providers.keycloak',
'portal.apps.PortalConfig',
'api.apps.ApiConfig',
'drf_yasg',
]


REQUIREMENTS.TXT

wheel>=0.34.2
iso3166>=1.0.1
Django>=3.0.6
psycopg2-binary>=2.8.5
django-allauth>=0.41.0
djangorestframework>=3.11.0
django-extensions>=2.2.9
django-sslserver>=0.22
drf-yasg>=1.17.1

VIRTUAL ENVIRONMENT 

Within my project, I use a virtual environment. Packages have been installed through:

python3 -m pip install -r requirements.txt

TREE

├── README.md
├── api
│   ├── __init__.py
│   ├── __pycache__
│   ├── admin.py
│   ├── apps.py
│   ├── migrations
│   ├── models.py
│   ├── serializers.py
│   ├── tests.py
│   ├── urls.py
│   └── views.py
├── azure-pipelines.yml
├── db.sqlite3
├── manage.py
├── portal
│   ├── __init__.py
│   ├── __pycache__
│   ├── admin.py
│   ├── apps.py
│   ├── migrations
│   ├── models.py
│   ├── static
│   ├── templates
│   ├── tests.py
│   ├── urls.py
│   └── views.py
├── project
│   ├── __init__.py
│   ├── __pycache__
│   ├── asgi.py
│   ├── settings.py
│   ├── urls.py
│   └── wsgi.py
├── requirements.txt
├── startup.txt
├── static
│   ├── admin
│   ├── css
│   ├── django_extensions
│   ├── fonts
│   ├── img
│   ├── js
│   ├── login
│   ├── partners
│   ├── rest_framework
│   └── vendors
├── staticfiles
│   ├── admin
│   ├── css
│   ├── django_extensions
│   ├── drf-yasg
│   ├── fonts
│   ├── img
│   ├── js
│   ├── login
│   ├── partners
│   ├── rest_framework
│   └── vendors
├── templates
│   ├── account
│   ├── home
│   ├── html
│   ├── openid
│   ├── rest_framework
│   └── socialaccount
└── venv
    ├── bin
    ├── include
    ├── lib
    └── pyvenv.cfg


Reply all
Reply to author
Forward
0 new messages