-
Notifications
You must be signed in to change notification settings - Fork 123
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
Support for async-safety through asgiref's Local #176
Comments
Yes, even I wanted to understand if django-multitenant is compatible with ASGI and Channels server. I am new to Channels and ASGI, so need some advice before I port my current Django app which uses this library into an ASGI mode for some of the new features. |
@darwing1210 Do we have an eta when this can be released? |
I'm not sure, as it was never reviewed by the repo owners |
Hey @darwing1210 @arpanpreneur I'm reviewing right now. Thanks for your contributions |
add asgiref as test dependency add tests for asgiref add setting TENANT_USE_ASGIREF, updated tests
* Use asgiref when available instead of thread locals by @darwing1210 (#176) --------- Co-authored-by: Darwing Medina <[email protected]>
@gurkanindibay This can be closed as per fd84aee right? Thanks for the contributions - amazing project, thanks a lot! :) |
We are looking to switch to ASGI soon and are freshly using django-multitenant as well. As the
threading.local
is being used by django-multitenant, I'm afraid of cross-request tenant leakages.I therefore suggest an approach similar to django-simple-history:
This should use asgiref's
Local
as an asgi-safe alternative tothreading.locals
as per my understanding. As asgiref.local is meant as a drop-in replacement, the change should be straightforward.The text was updated successfully, but these errors were encountered: