any harm in put django request object in thread local dict?
-
12-09-2019 - |
Question
I have some custom render_to_response
methods which now needs request object, I could pass request to each one of them but instead I am saving request object in a middleware to thread local space and accessing it elsewhere, can it affect me anyway?
Solution
There shouldn't be any. Here you should find everything you need:
http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow