-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Error while retrieving session from request in middleware in async environment #3612
Comments
I can confirm the issue. It occurs when the session has not been loaded yet, and the middleware is the first one to trigger the actual load. Possibly related: https://code.djangoproject.com/ticket/34901 Trouble is, there is no way of triggering the load of a session asynchronously due to the ticket above, and using TBD what to do. |
Here -- https://github.com/django/django/pull/17372/files -- |
I have been seeing the same error. The #3614 update fixed it. Thanks! |
Merged. |
Hello!
I get the following error when I upgraded django-allauth from 55.2 to 60.1.
After further investigation the cause of this is the following:
In the AccountMiddleware. Trying to access session is a (sync) database request. However, since I am running it from an async environment, Django throws an error. Trying to find a solution is hard, since I cannot remove AccountMiddleware, since Django won't start due to an Improperly configured error.
Is there anything I could do to solve this?
Thanks!
The text was updated successfully, but these errors were encountered: