Reputation: 64
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!
Upvotes: 1
Views: 1174
Reputation: 6844
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.
Upvotes: 3