https://github.com/bottlepy/bottle-beaker
Bottle plugin to session and caching library with WSGI Middleware
https://github.com/bottlepy/bottle-beaker
Last synced: about 1 year ago
JSON representation
Bottle plugin to session and caching library with WSGI Middleware
- Host: GitHub
- URL: https://github.com/bottlepy/bottle-beaker
- Owner: bottlepy
- License: mit
- Created: 2014-03-26T17:36:00.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2016-07-20T19:29:02.000Z (almost 10 years ago)
- Last Synced: 2025-04-10T00:28:36.770Z (about 1 year ago)
- Language: Python
- Size: 5.86 KB
- Stars: 18
- Watchers: 5
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
=============
bottle-beaker
=============
Bottle plugin to session and caching library with WSGI Middleware
Example
-------
.. code-block:: python
import bottle
from bottle.ext import beaker
session_opts = {
'session.type': 'file',
'session.cookie_expires': 300,
'session.data_dir': './data',
'session.auto': True
}
app = beaker.middleware.SessionMiddleware(bottle.app(), session_opts)
@bottle.route('/test')
def test():
s = bottle.request.environ.get('beaker.session')
s['test'] = s.get('test',0) + 1
s.save()
return 'Test counter: %d' % s['test']
bottle.run(app=app)