1

I have a application on Django 1.8.8 with cache based on django-redis. And I want to update to Django 1.9.2. But django-redis not working with Django >= 1.9.

django-redis-cache also not working with Django 1.9 (for me). And I not found requirements in the documentation of django-redis-cache.

Have anyone any experience with cache in Redis with Django 1.9+? Thanks!

Shmele
  • 64
  • 6
  • 2
    Do you know that django-redis does definitely not support 1.9, or have they just not updated the documentation to say that they do? – Daniel Roseman Mar 01 '16 at 14:20
  • Now I see that django-redis is working with Django 1.9 with cache configuration as that of Forge. Earlier, my configuration is not an element named "OPTIONS". – Shmele Mar 01 '16 at 20:28

1 Answers1

3

I'm using Django 1.9 and django-redis version 4.3, I've set my cache to use RedisCache:

CACHES = {
    "default": {
        "BACKEND": "django_redis.cache.RedisCache",
        "LOCATION": "redis://127.0.0.1:6379/1",
        "OPTIONS": {
            "CLIENT_CLASS": "django_redis.client.DefaultClient",
        }
    }
}

Follow the tutorial here.


And set values in my cache:

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

I was able to access those values on redis using redis-cli, so I guess it's seems to be working.

Forge
  • 6,538
  • 6
  • 44
  • 64