--- id: django-redis version: "7.0.0" license: BSD-3-Clause license_treatment: permissive maintenance: active --- # django-redis — Full featured redis cache backend for Django. License: permissive · Maintenance: active · Downloads: 12.7M/mo ## What it is and what it does django-redis is a production-ready Redis cache and session backend for Django that replaces Django's default cache framework with Redis storage. It uses redis-py's native URL notation for connection strings, supporting TCP sockets, SSL-wrapped connections, and Unix domain sockets. The package handles serialization via pickle by default, offers pluggable compression (zlib, lzma, lz4, zstandard, gzip), and can emulate memcached exception behavior by ignoring Redis connection failures. Typically used to improve Django application performance by offloading cache and session storage to Redis, it integrates directly into Django's CACHES and SESSION_ENGINE settings. The package supports Redis ACLs, primary/secondary failover in the default client, infinite timeouts, and raw access to the underlying redis connection pool for advanced use cases. It has been used in production across multiple projects and maintains a comprehensive test suite. Use it for: - Replace Django's default in-memory cache with persistent Redis storage for multi-process deployments. - Store Django sessions in Redis for horizontal scaling across multiple application servers. - Enable cache compression to reduce memory usage on large cached objects. - Configure Redis failover and primary/secondary support for high-availability caching. - Use Unix domain sockets to cache locally without network overhead. - Emulate memcached behavior by ignoring Redis downtime to prevent application crashes. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides a Redis cache and session backend for Django, supporting native redis-py URL connection strings, pluggable serializers and parsers, and optional compression. Yes. django-redis is actively maintained, production-proven, has no known vulnerabilities, low install friction, and a permissive license. It is the standard choice for Redis caching in Django projects that need persistence, scalability, or session sharing across servers. Install if you are using Django 5.2+ and have a Redis server available. ## Install pip install django-redis uv add django-redis poetry add django-redis ## Installing django-redis Before you install: Low install friction with a pure Python wheel. Actively maintained (last commit 2026-08-10) with production use across multiple projects. Requires Django 5.2+, redis 4.0.2+, and Python 3.10+. License in practice: BSD-3-Clause permissive license allows commercial and private use with minimal restrictions; attribution required. Quickstart: pip install django-redis # In Django settings.py: CACHES = { "default": { "BACKEND": "django_redis.cache.RedisCache", "LOCATION": "redis://127.0.0.1:6379/1", } } # Use cache: from django.core.cache import cache cache.set('key', 'value') value = cache.get('key') Requires a running Redis server (2.8+) and Django 5.2+, Python 3.10+. Verify before relying: - Whether compression libraries (lz4, pyzstd) are automatically installed or optional dependencies. - Performance characteristics compared to other Django cache backends in typical workloads. - Specifics of how pluggable clients and parsers extend the default behavior. ## Package facts - License: BSD-3-Clause (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 12.7M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags django redis cache backend, redis session storage django, django caching with redis, redis-py django integration, django cache configuration, redis connection pooling django, django cache invalidation, django-integration, caching-layer, session-storage [View on SkillFed](https://skillfed.io/packages/django-redis) · [View on PyPI](https://pypi.org/project/django-redis/)