Comments (8)
Thanks for confirming, making it official here a96c99e
from django-allauth.
Can you share the full stack trace? Also please include the python version you are using. I have trouble reproducing this issue. Is this running vanilla allauth, or do you have custom adapters & forms? Can you try commenting those out?
from django-allauth.
I just submitted a fix. If you'd still like the stack trace, please let me know. Looks like the issue was caused when using secure_admin_login
and importing it with from allauth.account.decorators import secure_admin_login
.
from django-allauth.
If you'd still like the stack trace, please let me know.
Yes please. I would like to understand why this issue is not being exposed in the test suite and why it also doesn't show up in the example projects.
from django-allauth.
If you'd still like the stack trace, please let me know.
Yes please. I would like to understand why this issue is not being exposed in the test suite and why it also doesn't show up in the example projects.
Sure thing, below is the stack trace. This is with Python 3.12.1 and Django 5.0.6:
Traceback (most recent call last):
File "/Users/user/devel/project/./manage.py", line 23, in <module>
main()
File "/Users/user/devel/project/./manage.py", line 19, in main
execute_from_command_line(sys.argv)
File "/Users/user/.pyenv/versions/3.12.1/envs/project/lib/python3.12/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
utility.execute()
File "/Users/user/.pyenv/versions/3.12.1/envs/project/lib/python3.12/site-packages/django/core/management/__init__.py", line 416, in execute
django.setup()
File "/Users/user/.pyenv/versions/3.12.1/envs/project/lib/python3.12/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Users/user/.pyenv/versions/3.12.1/envs/project/lib/python3.12/site-packages/django/apps/registry.py", line 124, in populate
app_config.ready()
File "/Users/user/.pyenv/versions/3.12.1/envs/project/lib/python3.12/site-packages/django/contrib/admin/apps.py", line 27, in ready
self.module.autodiscover()
File "/Users/user/.pyenv/versions/3.12.1/envs/project/lib/python3.12/site-packages/django/contrib/admin/__init__.py", line 52, in autodiscover
autodiscover_modules("admin", register_to=site)
File "/Users/user/.pyenv/versions/3.12.1/envs/project/lib/python3.12/site-packages/django/utils/module_loading.py", line 58, in autodiscover_modules
import_module("%s.%s" % (app_config.name, module_to_search))
File "/Users/user/.pyenv/versions/3.12.1/lib/python3.12/importlib/__init__.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 994, in exec_module
File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
File "/Users/user/devel/project/project/users/admin.py", line 7, in <module>
from allauth.account.decorators import secure_admin_login
File "/Users/user/.pyenv/versions/3.12.1/envs/project/lib/python3.12/site-packages/allauth/account/decorators.py", line 10, in <module>
from allauth.account import reauthentication
File "/Users/user/.pyenv/versions/3.12.1/envs/project/lib/python3.12/site-packages/allauth/account/reauthentication.py", line 11, in <module>
from allauth.account.internal.flows.reauthentication import (
File "/Users/user/.pyenv/versions/3.12.1/envs/project/lib/python3.12/site-packages/allauth/account/internal/__init__.py", line 1, in <module>
from allauth.account.internal import flows
File "/Users/user/.pyenv/versions/3.12.1/envs/project/lib/python3.12/site-packages/allauth/account/internal/flows/__init__.py", line 1, in <module>
from allauth.account.internal.flows import (
File "/Users/user/.pyenv/versions/3.12.1/envs/project/lib/python3.12/site-packages/allauth/account/internal/flows/manage_email.py", line 7, in <module>
from allauth.account.reauthentication import raise_if_reauthentication_required
ImportError: cannot import name 'raise_if_reauthentication_required' from partially initialized module 'allauth.account.reauthentication' (most likely due to a circular import) (/Users/user/.pyenv/versions/3.12.1/envs/project/lib/python3.12/site-packages/allauth/account/reauthentication.py)
from django-allauth.
It looks like this issue may be due to using secure_admin_login
in an admin.py
(as is done here in django-cookiecutter, instead of calling secure_admin_login
from the urls.py, as is done here in the example project.
I moved the use of 'secure_admin_login` to the urls.py and it resolved the issue.
from django-allauth.
I tried to alter the example project and move the import in admin.py, but still it did not show up. In any case, I have done a bit more elaborate fix over at 322635f -- but given that I cannot reproduce the issue, could you give the current main branch a try?
from django-allauth.
That fixes it!
from django-allauth.
Related Issues (20)
- social_account_added signal not called HOT 2
- How to Resolve "Application labels aren't unique" Error When Adding allauth Services to a Django Project with Existing 'account' App HOT 1
- Is it possible to configure microsoft/azure login/api endpoint? HOT 1
- Google provider login do not authenticate specific user for production env HOT 6
- Comparing ACSView / FinishACSView and Headless SSO endpoint
- Facebook auth works, but does not create a user account HOT 7
- NPM package to streamline the use of allauth headless in JS apps HOT 3
- SAML basic questions
- Documentation for installing mfa has slight issue HOT 1
- Facebook Graph API update create bug in Facebook Login HOT 1
- Login by code ("Magic code login") and unverified email addresses HOT 2
- HEADLESS_ONLY = True and socialaccount_connect combination HOT 3
- magic link only auth HOT 7
- Google provider not showing in list of providers when adding social application in admin app using version 0.63.2 HOT 4
- Doc mismatch for HEADLESS_FRONTEND_URLS setting HOT 1
- Check if email is already registered in POST `/account/signup` HOT 1
- Email2 field not being converted to lowercase, comparing fails HOT 4
- Incorrect link to demo in docs HOT 1
- Telegram authentication needs /setdomain for your website. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-allauth.