summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Kaplan-Moss <jacob@jacobian.org>2005-10-29 17:05:19 +0000
committerJacob Kaplan-Moss <jacob@jacobian.org>2005-10-29 17:05:19 +0000
commit2822f71d08f3a94a3e26bb80fa1dbcef7bf2f1db (patch)
treea9f42a6dcebfde6d23e3e7c8e059bda8a7d6e32e
parentf12e3243326a2b6b0d09206b373b34e028eab25c (diff)
Fixed #140: memcached backends may now use multiple servers
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1021 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/core/cache.py6
-rw-r--r--docs/cache.txt4
2 files changed, 7 insertions, 3 deletions
diff --git a/django/core/cache.py b/django/core/cache.py
index 6391304158..caeb315f05 100644
--- a/django/core/cache.py
+++ b/django/core/cache.py
@@ -13,7 +13,9 @@ settings.CACHE_BACKEND and use that to create and load a cache object.
The CACHE_BACKEND setting is a quasi-URI; examples are:
memcached://127.0.0.1:11211/ A memcached backend; the server is running
- on localhost port 11211.
+ on localhost port 11211. You can use
+ multiple memcached servers by separating
+ them with semicolons.
db://tablename/ A database backend in a table named
"tablename". This table should be created
@@ -134,7 +136,7 @@ else:
"Memcached cache backend."
def __init__(self, server, params):
_Cache.__init__(self, params)
- self._cache = memcache.Client([server])
+ self._cache = memcache.Client(server.split(';'))
def get(self, key, default=None):
val = self._cache.get(key)
diff --git a/docs/cache.txt b/docs/cache.txt
index 7db42db249..c1b1352bca 100644
--- a/docs/cache.txt
+++ b/docs/cache.txt
@@ -29,7 +29,9 @@ Examples:
CACHE_BACKEND Explanation
============================== ===========================================
memcached://127.0.0.1:11211/ A memcached backend; the server is running
- on localhost port 11211.
+ on localhost port 11211. You can use
+ multiple memcached servers by separating
+ them with semicolons.
db://tablename/ A database backend in a table named
"tablename". This table should be created