0

I am trying the code in the django-redis documentation page (http://niwinz.github.io/django-redis/latest/#_expire_persist):

from django.core.cache import cache
cache.set("foo", "value", timeout=25)

I am getting an error message when running this code: "redis.exceptions.ConnectionError: Error 10061 connecting to 127.0.0.1:6379. No connection could be made because the target machine actively refused it."

I set my cache settings in the settings.py page as described in the documentation, and I do not think the problem is being caused by a firewall, as I was able to get the regular redis caching with JSON to work. What could be causing the problem, and how should I fix it?

Alex
  • 3,946
  • 11
  • 38
  • 66
  • Is redis running on a different machine that the Django server? If so, you need to use the IP address of that machine, instead of `127.0.0.1`. – Alasdair Dec 07 '15 at 22:33
  • No, I am running it on my computer in Visual Studio. 127.0.0.1 should be correct. – Alex Dec 07 '15 at 22:40
  • Are you able to use `redis-cli` to access redis server? Is the redis server running persistently? – Shang Wang Dec 07 '15 at 22:48
  • Hmm, I never read about redis-cli in the docs. How do I use it? Thanks. – Alex Dec 07 '15 at 23:18

0 Answers0