views:

29

answers:

1

To share a state(e.g. user) between a module in django people sometime use thread local storage, but as google app engine follows CGI standard and keeps state of a request in os.environ , can I share objects between two modules just by setting it e.g.

mod1.my_data = {} and now any other module can get handle to my_data?

without worrying about other threads/requests sharing/overwriting it?

A: 

Later requests that happen to be served on the same process (you can't control that) would access just the same mod1.my_data object (unless you take pains to reassign it as a fresh object at the start of each request, of course).

Alex Martelli
thanks, yes I am setting data in a middleware, so every request sees correct data
Anurag Uniyal