我正在使用Django = 1.5.4并且我已经在ubuntu中正确安装了redis。我安装了django-redis。但是我得到了这个错误。我把' redis_cache'在我的django设置中。但是我收到了这个错误
ImportError: No module named redis_cache
怎么办?
答案 0 :(得分:8)
您应该添加django_redis
而不是redis_cache
。
如果你来自
django-redis < 3.8.x
,你可能正在使用redis_cache
。由于django-redis 3.8.x,redis_cache
模块是 弃用赞成django_redis
。redis_cache
模块将是 在3.9.x版本中删除。
答案 1 :(得分:4)
Django的Redis缓存后端
运行python setup.py install
进行安装,或将django_redis
放在Python路径上。
您也可以使用以下内容进行安装:pip install django-redis
答案 2 :(得分:1)
使用this提供的以下命令: pip install redis-simple-cache