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')
Release files for Flask-PyMemcache 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| flask_pymemcache-0.0.8.tar.gz | 2.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| flask_pymemcache-0.0.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.1 kB
Release files / flask_pymemcache-0.0.8.tar.gz
| Download URL | flask_pymemcache-0.0.8.tar.gz |
|---|---|
| Size | 2.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
be4146783ca9e9fc4c28e5aa33b300b1332e26b0345428ab8563f66106301e3a
|
|
BLAKE2b-256 checksum How to use checksums |
7774e2883fb08dcd7ce7f77b2e68fc20223ef622ac84b7e827f1cc215f720d45
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.12.2
|
Release files / flask_pymemcache-0.0.8-py3-none-any.whl
| Download URL | flask_pymemcache-0.0.8-py3-none-any.whl |
|---|---|
| Size | 3.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
588dbe398866280cf72503f7c95276fe913f12dd4b3bfec9102e4e5e1ed15233
|
|
BLAKE2b-256 checksum How to use checksums |
28d3edc6bfce7d8d9f373296d6dd8037941c7ba60d6a88903d49e33ac6e7bd57
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.12.2
|