pymemcache integration for Flask
Project description
Initialize
memcache = FlaskPyMemcache(app)
or:
memcache = FlaskPyMemcache() memcache.init_app(app)
Configuration
Put kwargs for pymemcache to PYMEMCACHE in your Flask configuration.
PYMEMCACHE = { 'server': ('localhost', 11211), 'connect_timeout': 1.0, 'timeout': 0.5, 'no_delay': True, }
You can use different config key with conf_key keyword:
session = FlaskPyMemcache(conf_key='MEMCACHE_SESSION') cache = FlaskPyMemcache(conf_key='MEMCACHE_CACHE') session.init_app(app) cache.init_app(app)
In addition to normal pymemcache kwargs, Flask-PyMemcache provides following configuration options.
prefix – Add prefix to all key. (Default: b’’)
close_on_teardown – Close connection to memcached when app teardown.
Use
memcache.client.set('foo', 'bar')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Flask-PyMemcache-0.0.3.tar.gz
(2.2 kB
view hashes)
Built Distribution
Close
Hashes for Flask_PyMemcache-0.0.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6c4825562fddd1a0b31e83f3912d4ffbd2fa63d1765e3137225dec4203f5656 |
|
MD5 | 325f5740d2f36c6365467e699ebd5acb |
|
BLAKE2b-256 | 7daa4862fb9e8a62c1d17730c5ad12a10d24afb9ec8adb3db035ac20189ab5d0 |