pymemcache integration for Flask
Reason this release was yanked:
package is broken
Project description
Install
Install from https://pypi.org/project/Flask-PyMemcache/
pip install Flask-PyMemcache
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, 'key_prefix': b'myapp-', }
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.
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.7.tar.gz
(2.7 kB
view hashes)
Built Distribution
Close
Hashes for flask_pymemcache-0.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f292082d04cdd134e945aea5889e7618797a505a093520d1419594307fff70d3 |
|
MD5 | 18d6d9a0db9fa938f68f819087af4219 |
|
BLAKE2b-256 | c400cdd079e1e6f2a76093ba594e94b3dd1294826499384182212ddd4e960e66 |