I’m using the Python2.7 runtime with threadsafe set to false in the manifest.
Am I safe to do
user = users.get_current_user()
once at the top of the script, in the global space, and reference it from within various handlers without any namespace problems?
It is better to create a base class, add some functions there and then extend from base class all your handlers, because
get_current_user()has to do with the request handler and make sense only there.Here is an example: