ImportError:没有名为redis_cache的模块

时间:2016-03-27 18:55:24

标签: python django python-2.7 redis

我正在使用Django = 1.5.4并且我已经在ubuntu中正确安装了redis。我安装了django-redis。但是我得到了这个错误。我把' redis_cache'在我的django设置中。但是我收到了这个错误

ImportError: No module named redis_cache

怎么办?

3 个答案:

答案 0 :(得分:8)

您应该添加django_redis而不是redis_cache

documentation说:

  

如果你来自django-redis < 3.8.x,你可能正在使用   redis_cache。由于django-redis 3.8.x,redis_cache模块是   弃用赞成django_redisredis_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