=====================
Bottle-Memcache
=====================
Memcache is a general-purpose distributed memory caching system that was
originally developed by Danga Interactive for LiveJournal, but is now used
by many other sites.
This plugin simplifies the use of memcache in your Bottle applications.
Once installed, all you have to do is to add a ``mc`` keyword argument
(configurable) to route callbacks that need a memcache connection.
Installation
===============
Install with one of the following commands::
$ pip install bottle-memcache
$ easy_install bottle-memcache
or download the latest version from github::
$ git clone git://github.com/bottlepy/bottle-extras.git
$ cd bottle-extras/memcache
$ python setup.py install
Usage
===============
Once installed to an application, the plugin passes an open
:class:`memcache.Client` instance to all routes that require an
``mc`` keyword argument::
import bottle
import bottle.ext.memcache
app = bottle.Bottle()
plugin = bottle.ext.memcache.MemcachePlugin(servers=['localhost:11211'])
app.install(plugin)
@app.route('/show/:item')
def show(item, mc):
val = mc.get('item_key')
if not val:
mc.set('item_key', item)
val = mc.get('item_key')
return template('showitem', item=val)
Routes that do not expect an ``mc`` keyword argument are not affected.
Configuration
=============
The following configuration options exist for the plugin class:
* **servers**: A list of server:port items to connect to (default: ['localhost:11211',])
* **timeout**: The timeout value in seconds when connecting (default: 3)
* **keyword**: The keyword argument name that triggers the plugin (default: 'mc').
Bottle-Memcache
=====================
Memcache is a general-purpose distributed memory caching system that was
originally developed by Danga Interactive for LiveJournal, but is now used
by many other sites.
This plugin simplifies the use of memcache in your Bottle applications.
Once installed, all you have to do is to add a ``mc`` keyword argument
(configurable) to route callbacks that need a memcache connection.
Installation
===============
Install with one of the following commands::
$ pip install bottle-memcache
$ easy_install bottle-memcache
or download the latest version from github::
$ git clone git://github.com/bottlepy/bottle-extras.git
$ cd bottle-extras/memcache
$ python setup.py install
Usage
===============
Once installed to an application, the plugin passes an open
:class:`memcache.Client` instance to all routes that require an
``mc`` keyword argument::
import bottle
import bottle.ext.memcache
app = bottle.Bottle()
plugin = bottle.ext.memcache.MemcachePlugin(servers=['localhost:11211'])
app.install(plugin)
@app.route('/show/:item')
def show(item, mc):
val = mc.get('item_key')
if not val:
mc.set('item_key', item)
val = mc.get('item_key')
return template('showitem', item=val)
Routes that do not expect an ``mc`` keyword argument are not affected.
Configuration
=============
The following configuration options exist for the plugin class:
* **servers**: A list of server:port items to connect to (default: ['localhost:11211',])
* **timeout**: The timeout value in seconds when connecting (default: 3)
* **keyword**: The keyword argument name that triggers the plugin (default: 'mc').
Metadata
Release files for bottle-memcache 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bottle-memcache-0.2.1.tar.gz | 2.6 kB | Details |
Release files / bottle-memcache-0.2.1.tar.gz
| Download URL | bottle-memcache-0.2.1.tar.gz |
|---|---|
| Size | 2.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
849ba7861ada991cc46735b53c7e2241bbdc27d91982bd08c1eb7318ecd97a95
|
|
BLAKE2b-256 checksum How to use checksums |
690e48bb31fe35492610a5ad097e9e69d5faa578dc45055adf5c55eb0e4cebe1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |