python - 导入错误 : No module named redis_cache

标签 python django python-2.7 redis

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

ImportError: No module named redis_cache

怎么办?

最佳答案

您应该添加 django_redis而不是 redis_cache .

documentation说:

if you are coming from django-redis < 3.8.x, you are probably using redis_cache. Since django-redis 3.8.x, redis_cache module is deprecated in favor to django_redis. The redis_cache module will be removed in 3.9.x versions.

关于python - 导入错误 : No module named redis_cache,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36251291/

相关文章:

python - 继承和多态性

django - 请求对象没有用户 Django

python - Python有默认的缓存服务吗

django - 管理 UserCreationForm 属性和字段

python - 如何在 Django QuerySet 中将 DateField() + TimeField() 转换为本地时间?

python - json.loads() 不保持秩序

Python - 我怎样才能让客户端能够多次连接?

python - 隐藏 bq 命令行 `query` 输出

python - 为什么我的列表在我尝试 append 它们时没有加入 Python

python - Scrapy 的 HtmlResponse 不从 URL 检索数据