-
Notifications
You must be signed in to change notification settings - Fork 673
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
Django 3.0 Async Support #223
Comments
If you take a look at Django 3.0 development in Google Group, you'll find out that the creator of psycopg2 might be creating a native async psycopg3! So if you use Django 3.0 + psycopg3, it might not be necessary to change too much code. But for now, is anyone looking into creating this (besides me)? |
For those later on: I created a native Django 3.0 chat application (i.e. without django channels). In order to connect to a certain pool, the user first needs to perform a POST request to a view. The view returns a token. That view also adds the token to redis (or whatever your cache may be). The token is the key and the value is whatever you want it to be. When you connect via web sockets to a pool, the websocket.connect protocol will access the cache and look for the cache. Doing this with this package would not be good because simplejwt is not THAT customizable of an app. However, I can make it happen. But keeping up with celery and other things... |
Written in a gist (needs some more revision, but already deployed in an app using Redis pub/sub with SimpleJWT methodology for getting a custom TokenUser). |
I’m in need of utilizing Django 3.0’s asgi.py with authentication methodology. There already is an issue #71 raised for httpCookie storage, so web is covered, I suppose, since Django 3.0 can’t access the database being not thread safe.
When it comes to 3.0 support, the token blacklist and sliding token will not be available until Django 3.0 make db access thread safe. Plus, creating too many threads is going to kill any EC2 instance...
HOWEVER, when it comes to regular authentication, we should add a method for people to utilize. Or a function. My setup for asgi.py is as follows: https://dev.to/jaydenwindle/adding-websockets-to-your-django-app-with-no-extra-dependencies-2f6h
The authentication method should be a function that returns a Bool. OR, with the above link’s asgi.py setup, we could also automatically send a status code.
I’m suggesting this since simplejwt mainly serves mobile authentication rather than desktop as the aforementioned issue is developed for.
The text was updated successfully, but these errors were encountered: