Skip to main content

pymemcache integration for Flask

Project description

https://travis-ci.org/KLab/Flask-PyMemcache.png

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


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 details)

Uploaded Source

Built Distribution

Flask_PyMemcache-0.0.2-py2.py3-none-any.whl (4.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file Flask-PyMemcache-0.0.2.tar.gz.

File metadata

File hashes

Hashes for Flask-PyMemcache-0.0.2.tar.gz
Algorithm Hash digest
SHA256 9c17d89613f47f1499a88a202d345882f156ac6fc8320f938e903ebbceeb42cd
MD5 e8b4175df88a78326cc2905db56d3637
BLAKE2b-256 1353ce17b64e332b4736bde030f48ac159087f8e822a842fd8184004e1c8414d

See more details on using hashes here.

File details

Details for the file Flask_PyMemcache-0.0.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for Flask_PyMemcache-0.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 74dfc5eda24386f1df1e93c4b1c9012b78718ed3c5876a0aa250933c0a5a4272
MD5 547eda66d899114bdc37603dd5a87808
BLAKE2b-256 142d186f3a9c1db83a8913b9c3090f84a8d8837583fbe453087fe08d7aa871a9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page