+import threading
+
+
class RequestHolder(object):
- def __init__(self):
- self.request = None
+ _requests = threading.local()
+
+ @property
+ def request(self):
+ return self._requests.request
+
+ @request.setter
+ def request(self, value):
+ self._requests.request = value
-REQUEST_HOLDER = RequestHolder()
\ No newline at end of file
+REQUEST_HOLDER = RequestHolder()