Provides utilities for storing and retrieving values from threadlocals, and middleware to place the current Django request in threadlocal storage. Version 0.10 appears stable but unmaintained since 2012.
pip install django-threadlocalsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Add middleware, then retrieve the current request from anywhere.
if request := get_request(): ... else: handle_without_request()
Consider replacing with django-currentuser or custom middleware.
Place ThreadLocalMiddleware near the top of MIDDLEWARE list.
Use MIDDLEWARE (list) in settings.py for Django >= 1.10.