beaker.middleware – Middleware classes
Module Contents
- class beaker.middleware.CacheMiddleware(app, config=None, environ_key='beaker.cache', **kwargs)
Initialize the Cache Middleware
The Cache middleware will make a CacheManager instance available every request under the
environ['beaker.cache']key by default. The location in environ can be changed by settingenviron_key.configdict All settings should be prefixed by ‘cache.’. This method of passing variables is intended for Paste and other setups that accumulate multiple component settings in a single dictionary. If config contains no cache. prefixed args, then all of the config options will be used to initialize the Cache objects.
environ_keyLocation where the Cache instance will keyed in the WSGI environ
**kwargsAll keyword arguments are assumed to be cache settings and will override any settings found in
config
- class beaker.middleware.SessionMiddleware(wrap_app, config=None, environ_key='beaker.session', **kwargs)
Initialize the Session Middleware
The Session middleware will make a lazy session instance available every request under the
environ['beaker.session']key by default. The location in environ can be changed by settingenviron_key.configdict All settings should be prefixed by ‘session.’. This method of passing variables is intended for Paste and other setups that accumulate multiple component settings in a single dictionary. If config contains no session. prefixed args, then all of the config options will be used to initialize the Session objects.
environ_keyLocation where the Session instance will keyed in the WSGI environ
**kwargsAll keyword arguments are assumed to be session settings and will override any settings found in
config