django-currentuser
django-currentuser copied to clipboard
Should we be using asgiref.local.Local if available for import?
With django now supporting async, should we be trying to import asgiref.local.Local if available, which is a drop-in async replacement for threading.local?
Perhaps replacing:
from threading import local
With:
try:
from asgiref.local import Local as local
except ImportError:
from threading import local
Would be happy to make a PR for this, but not sure how to approach the situation where asgiref package is available vs when it is not.