def login_required(handler_method):
 def check_login(self, *args, **kwargs):
  if (self.request.method != 'GET'):
   self.abort(400, detail='The login_required decorator can only be used for GET requests.')
  user = users.get_current_user()
  if (not user):
   return self.redirect(users.create_login_url(self.request.url))
  else:
   handler_method(self, *args, **kwargs)
 return check_login

def login_required ( handler_method ) : def check_login ( self , * args , ** kwargs ) : if ( self . request . method != 'GET' ) : self . abort ( 400 , detail = 'The login_required decorator can only be used for GET requests.' ) user = users . get_current_user ( ) if ( not user ) : return self . redirect ( users . create_login_url ( self . request . url ) ) else : handler_method ( self , * args , ** kwargs ) return check_login
like djangos login_required .