Open huazhaozhe opened 5 years ago
Yes: Pull requests are welcome ;)
Another alternative seems to be contextvars (Python built-in). The library django-guid uses that: https://github.com/snok/django-guid/blob/main/django_guid/middleware.py And it seems they're a safe replacement for threading.local that works with asyncio as well: https://peps.python.org/pep-0567/#examples
Is it because django does not need to test the following conditions?
werkzeug.local Context Locals
Thanks! :D