im my projects I use a utils.py
file, in there is the code for many utilities methods used across my code, so i use this module to hold the session
object. allowing me to access the session wherever its need to.
The code stays with something like this:
import utils
class Login(object):
def GET(self):
if utils.session.login:
return "OK"
else:
return "Please login."