本文整理汇总了Python中dao.Dao.logout_user_or_none方法的典型用法代码示例。如果您正苦于以下问题:Python Dao.logout_user_or_none方法的具体用法?Python Dao.logout_user_or_none怎么用?Python Dao.logout_user_or_none使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dao.Dao
的用法示例。
在下文中一共展示了Dao.logout_user_or_none方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: delete
# 需要导入模块: from dao import Dao [as 别名]
# 或者: from dao.Dao import logout_user_or_none [as 别名]
def delete(self):
args = session_delete_parser.parse_args()
dao = Dao('norcal', mongo_client=mongo_client) # lol this doesn't matter, b/c we're just trying to log a user
logout_success = dao.logout_user_or_none(args['session_id'])
if not logout_success:
return 'who is you', 404
return 'logout success', 200, {'Set-Cookie': "session_id=deleted; expires=Thu, 01 Jan 1970 00:00:00 GMT"}
示例2: delete
# 需要导入模块: from dao import Dao [as 别名]
# 或者: from dao.Dao import logout_user_or_none [as 别名]
def delete(self):
args = session_delete_parser.parse_args()
dao = Dao(None, mongo_client=mongo_client)
if not dao:
return 'Dao not found', 404
logout_success = dao.logout_user_or_none(args['session_id'])
if not logout_success:
return 'who is you', 404
return ('logout success', 200,
{'Set-Cookie': "session_id=deleted; expires=Thu, 01 Jan 1970 00:00:00 GMT"})