Closed cugarteblair closed 10 months ago
django-redis package is one possibility:
CACHES = { "default": { "BACKEND": "django_redis.cache.RedisCache", "LOCATION": "redis://127.0.0.1:6379/1", # Your Redis URL "OPTIONS": { "CLIENT_CLASS": "django_redis.client.DefaultClient", } } }
test: from django.core.cache import cache
cache.set('test_key', 'test_value', 300) # Set a cache value with a 5-minute expiry value = cache.get('test_key') # Fetch the cache value print(value) # Should print 'test_value'
https://chat.openai.com/share/595bcebd-69c4-45e5-9579-549ee09cf718
This was fixed in v3.3.0
django-redis package is one possibility:
CACHES = { "default": { "BACKEND": "django_redis.cache.RedisCache", "LOCATION": "redis://127.0.0.1:6379/1", # Your Redis URL "OPTIONS": { "CLIENT_CLASS": "django_redis.client.DefaultClient", } } }
test: from django.core.cache import cache
cache.set('test_key', 'test_value', 300) # Set a cache value with a 5-minute expiry value = cache.get('test_key') # Fetch the cache value print(value) # Should print 'test_value'