django-pylibmc-sasl 0.2.4
Django cache backend using pylibmc-sasl
This package provides a memcached cache backend for Django using pylibmc. You want to use pylibmc because it's fast.
This is a fork of the django-pylibmc package. These changes will eventually end up upstream.
Requirements
django-pylibmc-sasl requires Django 1.3. It was written and tested on Python 2.7.x.
Usage
Your cache backend should look something like this:
CACHES = {
'default': {
'BACKEND': 'django_pylibmc.memcached.PyLibMCCache',
'LOCATION': 'localhost:11211',
'TIMEOUT': 500,
'BINARY': True,
'OPTIONS': { # Maps to pylibmc "behaviors"
'tcp_nodelay': True,
'ketama': True
}
}
}
If you want to use the memcached binary protocol, set the BINARY key's value to True as shown above. BINARY is False by default.
If you want to control pylibmc behaviors, use the OPTIONS. OPTIONS is an empty dict by default.
Pylibmc supports compression and the minimum size (in bytes) of values to compress can be set via the Django setting PYLIBMC_MIN_COMPRESS_LEN. The default is 0, which is disabled.
Caveats
This package breaks away from the current handling of timeout=0 in Django. Django converts 0 into the default timeout, while django-pylibmc leaves it as 0. memcached takes 0 to mean "infinite timeout." You can still pass None to get the default timeout.
| File | Type | Py Version | Uploaded on | Size | # downloads |
|---|---|---|---|---|---|
| django-pylibmc-sasl-0.2.4.tar.gz (md5) | Source | 2011-12-06 | 4KB | 1974 | |
- Author: Jeff Balogh (modified by Craig Kierstens)
- Home Page: http://github.com/kennethreitz/django-pylibmc-sasl
- License: BSD
-
Categories
- Development Status :: 4 - Beta
- Environment :: Web Environment
- Environment :: Web Environment :: Mozilla
- Framework :: Django
- Intended Audience :: Developers
- License :: OSI Approved :: BSD License
- Operating System :: OS Independent
- Programming Language :: Python
- Topic :: Software Development :: Libraries :: Python Modules
- Package Index Owner: kennethreitz
- DOAP record: django-pylibmc-sasl-0.2.4.xml
