Skip to main content

Thread safe pylibmc cache pbackend for django

Project description

version downloads license

Default django pylibmc cache backend don’t work correctly using multithread uWSGI or celery worker.

This package uses separate connection for each context (thread or async context) and can be used as direct replacement of django.core.cache.backends.memcached.PyLibMCCache.

Install

pip install django_pylibmc_threadsafe

Configuration

This package has only one additional option - ignore_exc used to suppress all exceptions (behavior used in old django.core.cache.backends.memcached.MemcachedCache backend). All other options are identical to django.core.cache.backends.memcached.PyLibMCCache.

Example configuration:

CACHES = {
        'default': {
                'BACKEND': 'django_pylibmc_threadsafe.PyLibMCCache',
                'LOCATION': '127.0.0.1:11211',
                'KEY_PREFIX': '',
                'OPTIONS': {
                        'binary': True,
                        'ignore_exc': True,
                        'behaviors': {
                                'ketama': True,
                        }
                }
        },

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

django_pylibmc_threadsafe-1.0.1.tar.gz (10.0 kB view hashes)

Uploaded Source

Built Distribution

django_pylibmc_threadsafe-1.0.1-py3-none-any.whl (3.8 kB view hashes)

Uploaded Python 3

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