【发布时间】:2011-06-05 15:02:55
【问题描述】:
我想使用 Redis。所以我跟着这个教程:https://github.com/sebleier/django-redis-cache
首先,我安装redis-py:https://github.com/andymccurdy/redis-py/
然后,我将其放入我的设置中:CACHE_BACKEND = 'redis_cache.cache://localhost:6379'
然后我在views.py中这样做:
from redis_cache import cache #this imports just fine!
cache.set("haha","lala")
print cache.get("haha")
但由于某种原因,我得到了一个 AttributeError:
Exception Type: AttributeError at /
Exception Value: 'module' object has no attribute 'set'
【问题讨论】:
标签: python database django caching redis