1、Flask模块中session与Flask-session组件中session的继承关系:
Flask模块sessions.py:
class SessionInterface(object): def open_session(self, app, request): raise NotImplementedError() def save_session(self, app, session, response): raise NotImplementedError() class SecureCookieSessionInterface(SessionInterface): def open_session(self, app, request): pass def save_session(self, app, session, response): pass
flask-session组件sessions.py:
class SessionInterface(FlaskSessionInterface): pass class NullSessionInterface(SessionInterface): pass class RedisSessionInterface(SessionInterface): pass class MemcachedSessionInterface(SessionInterface): pass class FileSystemSessionInterface(SessionInterface): pass class MongoDBSessionInterface(SessionInterface): pass class SqlAlchemySessionInterface(SessionInterface): pass
原文地址:https://www.cnblogs.com/bad-robot/p/10087504.html
时间: 2024-11-06 13:55:03