I am using Django=1.5.4 and I have installed redis properly in ubuntu. I installed django-redis. But I get this error. I put 'redis_cache' in my django settings. But I got this error
ImportError: No module named redis_cache
What to do?
I am using Django=1.5.4 and I have installed redis properly in ubuntu. I installed django-redis. But I get this error. I put 'redis_cache' in my django settings. But I got this error
ImportError: No module named redis_cache
What to do?
You are supposed to add django_redis
instead of redis_cache
.
The documentation says:
if you are coming from
django-redis < 3.8.x
, you are probably usingredis_cache
. Since django-redis 3.8.x,redis_cache
module is deprecated in favor todjango_redis
. Theredis_cache
module will be removed in 3.9.x versions.
Redis cache backend for Django
Run python setup.py install
to install, or place django_redis
on your Python path.
You can also install it with: pip install django-redis
Use following command as available at this:
pip install redis-simple-cache
you are missing django_redis module run below command to add the module:
pip install django-redis
I was using docker compose + poetry to manage dependencies, and the solution for me to get rid of this Redis error was:
It seems like it was a cache issue, at least in my case.
Maybe there's a more surgical way of doing this, but these steps certainly are helpful when you've already double checked all dependencies and project settings.
© 2022 - 2024 — McMap. All rights reserved.
python2 -c "import redis_cache"
– Same