Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Fixed #3648 -- Added support for cmemcached Python library. Thanks, f…


git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit a5bb14ed2e3e1a26a4f7312582cf3e350bdd3985 1 parent 9c10a2f
@adrianholovaty adrianholovaty authored
Showing with 18 additions and 6 deletions.
  1. +5 −2 django/core/cache/backends/
  2. +13 −4 docs/cache.txt
7 django/core/cache/backends/
@@ -3,9 +3,12 @@
from django.core.cache.backends.base import BaseCache, InvalidCacheBackendError
- import memcache
+ import cmemcache as memcache
except ImportError:
- raise InvalidCacheBackendError, "Memcached cache backend requires the 'memcache' library"
+ try:
+ import memcache
+ except:
+ raise InvalidCacheBackendError("Memcached cache backend requires either the 'memcache' or 'cmemcache' library")
class CacheClass(BaseCache):
def __init__(self, server, params):
17 docs/cache.txt
@@ -66,10 +66,19 @@ deleting arbitrary data in the cache. All data is stored directly in memory,
so there's no overhead of database or filesystem usage.
After installing Memcached itself, you'll need to install the Memcached Python
-bindings. They're in a single Python module,, available at
- . If that URL is no longer valid,
-just go to the Memcached Web site ( and get the
-Python bindings from the "Client APIs" section.
+bindings. Two versions of this are available. Choose and install *one* of the
+following modules:
+ * The fastest available option is a module called ``cmemcache``, available
+ at . (This module is only compatible with
+ the Django development version. Django 0.96 is only compatible with the
+ second option, below.)
+ * If you can't install ``cmemcache``, you can install ``python-memcached``,
+ available at . If that URL is
+ no longer valid, just go to the Memcached Web site
+ ( and get the Python bindings from the
+ "Client APIs" section.
To use Memcached with Django, set ``CACHE_BACKEND`` to
``memcached://ip:port/``, where ``ip`` is the IP address of the Memcached

0 comments on commit a5bb14e

Please sign in to comment.
Something went wrong with that request. Please try again.