Commit 54ace502 authored by Stephane Angel's avatar Stephane Angel

following updates in django 1.3 dev

parent a77fcb9f
...@@ -20,7 +20,15 @@ Usage ...@@ -20,7 +20,15 @@ Usage
2. Modify your Django settings to use ``redis_cache`` :: 2. Modify your Django settings to use ``redis_cache`` ::
CACHE_BACKEND = 'redis_cache.cache://<host>:<port>' CACHES = {
'default': {
'BACKEND': 'redis_cache.cache.CacheClass',
'LOCATION': '<host>:<port>',
'OPTIONS': { # optional
'DB': 1,
},
},
}
......
...@@ -15,12 +15,12 @@ except ImportError: ...@@ -15,12 +15,12 @@ except ImportError:
class CacheClass(BaseCache): class CacheClass(BaseCache):
def __init__(self, server, params, key_prefix='', version=1, key_func=None): def __init__(self, server, params):
""" """
Connect to Redis, and set up cache backend. Connect to Redis, and set up cache backend.
""" """
BaseCache.__init__(self, params, key_prefix, version, key_func) BaseCache.__init__(self, params)
db = params.get('db', 1) db = params.get('OPTIONS', {}).get('db', 1)
try: try:
db = int(db) db = int(db)
except (ValueError, TypeError): except (ValueError, TypeError):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment