Look around for python docs on threading.local, which lets you set a
'global' variable for just that thread.  Since a request is only going
to happen in a single thread, that lets you have a per-request global
that can be used for cache storage.  With middleware to set the
threading local instance up, and remove it at the end of the request.
I think it will do what you want.  One bit of weirdness I noticed was
that you always need to import the global in exactly the same way
everywhere you want it, otherwise you may not be referring to the same
variable.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to