{"id":21159,"library":"django-redis-cache","title":"django-redis-cache","description":"A Redis cache backend for Django, providing a simple and efficient way to use Redis as your cache store. Current version is 3.0.1. The library is stable with infrequent releases, mainly maintenance updates. It supports Django 2.2+.","status":"active","version":"3.0.1","language":"python","source_language":"en","source_url":"https://github.com/sebleier/django-redis-cache","tags":["django","redis","cache","backend"],"install":[{"cmd":"pip install django-redis-cache","lang":"bash","label":"Install via pip"}],"dependencies":[{"reason":"Required Redis client library","package":"redis","optional":false},{"reason":"Django framework","package":"Django","optional":false}],"imports":[{"note":"django-redis-cache uses its own RedisCache class; django-redis is a different library.","wrong":"from django_redis import RedisCache","symbol":"RedisCache","correct":"from redis_cache import RedisCache"}],"quickstart":{"code":"# settings.py\nCACHES = {\n    'default': {\n        'BACKEND': 'redis_cache.RedisCache',\n        'LOCATION': 'redis://127.0.0.1:6379/1',\n        'OPTIONS': {\n            'CLIENT_CLASS': 'redis_cache.client.DefaultClient',\n        }\n    }\n}\n\n# Usage\nfrom django.core.cache import cache\ncache.set('my_key', 'hello', timeout=300)\nprint(cache.get('my_key'))","lang":"python","description":"Configure the Redis cache backend and use Django's cache API."},"warnings":[{"fix":"Ensure you install the correct library and use the correct backend string.","message":"Do not confuse django-redis-cache with django-redis. They have different import paths and backends. django-redis-cache uses BACKEND = 'redis_cache.RedisCache' while django-redis uses 'django_redis.cache.RedisCache'.","severity":"gotcha","affected_versions":"all"},{"fix":"If you previously installed 'redis-cache', you need to uninstall and install 'django-redis-cache'.","message":"Version 3.0.0 renamed the package from 'redis_cache' to 'django-redis-cache'. The import path changed from 'redis_cache' to 'redis_cache'? Actually, the module name is still 'redis_cache', but the pip package changed. Ensure you use 'pip install django-redis-cache'.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Update your CACHES settings: BACKEND = 'redis_cache.RedisCache'","message":"The 'redis_cache.cache.RedisCache' class is deprecated; use 'redis_cache.RedisCache' directly.","severity":"deprecated","affected_versions":">=3.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run 'pip install django-redis-cache' and use 'import redis_cache'.","cause":"Installed wrong package or outdated import path.","error":"ModuleNotFoundError: No module named 'redis_cache'"},{"fix":"Ensure you have installed django-redis-cache and set BACKEND = 'redis_cache.RedisCache'.","cause":"Misspelled BACKEND or using wrong library.","error":"ImproperlyConfigured: The cache backend 'redis_cache.RedisCache' does not exist"},{"fix":"Start Redis server using 'redis-server' or configure LOCATION to a running instance.","cause":"Redis server is not running.","error":"redis.exceptions.ConnectionError: Error 10061 connecting to localhost:6379. No connection could be made because the target machine actively refused it."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}