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.2.tar.gz
(2.2 kB
view hashes)
Built Distribution
Close
Hashes for Flask_PyMemcache-0.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74dfc5eda24386f1df1e93c4b1c9012b78718ed3c5876a0aa250933c0a5a4272 |
|
MD5 | 547eda66d899114bdc37603dd5a87808 |
|
BLAKE2b-256 | 142d186f3a9c1db83a8913b9c3090f84a8d8837583fbe453087fe08d7aa871a9 |