Hello,
In GAE, you can say users.get_current_user()
to get the currently logged-in user implicit to the current request. This works even if multiple requests are being processed simultaneously -- the users
module is somehow aware of which request the get_current_user
function is being called on behalf of. I took a look into the code of the module in the development server, and it seems to be using os.environ
to get the user email and other values associated to the current request.
Does this mean that every request gets an independent os.environ
object?
I need to implement a service similar to users.get_current_user()
that would return different values depending on the request being handled by the calling code. Assuming os.environ
is the way to go, how do I know which variable names are already being used (or reserved) by GAE?
Also, is there a way to add a hook (or event handler) that gets called before every request?