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, '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
Built Distribution
File details
Details for the file Flask-PyMemcache-0.0.5.tar.gz
.
File metadata
- Download URL: Flask-PyMemcache-0.0.5.tar.gz
- Upload date:
- Size: 2.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67c06570366eb66cbecfb6838e171e11243b6e25933abd5877a8d3aa34e91ef5 |
|
MD5 | 3dd37f77db1de741a44a29f6a74eab31 |
|
BLAKE2b-256 | 2a220e4b422eb7a5fc34b97526e7518c39dcfc02f527e0cc6d833304dac4a860 |
File details
Details for the file Flask_PyMemcache-0.0.5-py2.py3-none-any.whl
.
File metadata
- Download URL: Flask_PyMemcache-0.0.5-py2.py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09b315dad4055d1bfe2466a23ed3d4f0b97d4a83dd1f948edd2d615b8a5dd44f |
|
MD5 | cde38ec2b303775478433e3fa754e62b |
|
BLAKE2b-256 | fc8a7f915ff12dd83bfc9c7b465108cd6cb92e7adefc5e9558469169e7eff720 |