在 Django 中使用 Redis 做缓存:django-redis-cache
项目名称:Redis Django Cache Backend
项目主页:https://github.com/sebleier/django-redis-cache
需要 redis-py 支持:http://github.com/andymccurdy/redis-py/
下载后采用 setup.py install 方式安装,或者直接放到你的可用路径下皆可。
修改 Django 的 设置:
On Django < 1.3:
CACHE_BACKEND = 'redis_cache.cache://<host>:<port>'
On Django >= 1.3:
CACHES = {
'default': {
'BACKEND': 'redis_cache.RedisCache',
'LOCATION': '<host>:<port>',
'OPTIONS': { # optional
'DB': 1,
'PASSWORD': 'yadayada',
},
},
}
请详细查看项目主页上的文档。
