Code Monkey home page Code Monkey logo

Comments (6)

pennersr avatar pennersr commented on June 20, 2024

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 sync_to_async in the middleware does not sound like a plan as the middleware always kicks in, meaning all views would be hampered by this.

TBD what to do.

from django-allauth.

pennersr avatar pennersr commented on June 20, 2024

Here -- https://github.com/django/django/pull/17372/files -- request.session.ahas_key() is being introduced, which is what the middleware should be using. Looks like this issue is blocked on missing Django functionality.

from django-allauth.

pennersr avatar pennersr commented on June 20, 2024

Given that the Django pull request is using sync_to_async() under the hood as well, see #3614

Can you give this a try @jvdboog ?

from django-allauth.

bkbirr avatar bkbirr commented on June 20, 2024

I have been seeing the same error. The #3614 update fixed it. Thanks!

from django-allauth.

pennersr avatar pennersr commented on June 20, 2024

Merged.

from django-allauth.

pennersr avatar pennersr commented on June 20, 2024

@bkbirr @jvdboog I would appreciate it if you could comment over at #3546 what, according to you, is missing / needs to be done in order to improve interop with async. If all is simply working as is for you, then that is also valuable information to hear.

from django-allauth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.