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
Built Distribution
File details
Details for the file Flask-PyMemcache-0.0.3.tar.gz
.
File metadata
- Download URL: Flask-PyMemcache-0.0.3.tar.gz
- Upload date:
- Size: 2.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cca2748c0096284f2a1f31be9ca04feed2ed2e4379f49c320bf86e2d0a5c9008 |
|
MD5 | 0a538e55dfc40961efb5053513ab44c3 |
|
BLAKE2b-256 | a3c5fe5b4a696b1f8ec3bc37f25e84b9ac061fc34c2d80dc006288d5f0eaf036 |
File details
Details for the file Flask_PyMemcache-0.0.3-py2.py3-none-any.whl
.
File metadata
- Download URL: Flask_PyMemcache-0.0.3-py2.py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6c4825562fddd1a0b31e83f3912d4ffbd2fa63d1765e3137225dec4203f5656 |
|
MD5 | 325f5740d2f36c6365467e699ebd5acb |
|
BLAKE2b-256 | 7daa4862fb9e8a62c1d17730c5ad12a10d24afb9ec8adb3db035ac20189ab5d0 |