1. 程式人生 > >Flask組件之Flask-session

Flask組件之Flask-session

組件 .py int elf mem ESS iss memcached sse

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

Flask組件之Flask-session