django-redis
Full featured redis cache backend for Django.
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires a running Redis server (2.8+) and Django 5.2+, Python 3.10+.
- Low install friction with a pure Python wheel.
- Actively maintained (last commit 2026-08-10) with production use across multiple projects.
License · maintenance · safety
BSD-3-Clause (permissive) — BSD-3-Clause permissive license allows commercial and private use with minimal restrictions; attribution required.
last release 2026-06-02 (73 days) · last repo commit 2026-08-10 · 3,080 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 12,685,319 downloads/mo, #1,312 on PyPI
Alternatives
Verify before relying
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')- 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.
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 on this page. Verify before relying on it.
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
django-redis on PyPI
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+.
Requires a running Redis server (2.8+) and Django 5.2+, 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')
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 the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagesDjangoredistyping_extensions |
| Maintenance | Actively maintained 73 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 12,685,319 / month, #1,312 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentFramework :: DjangoFramework :: Django :: 5.2Framework :: Django :: 6.0Intended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: LibrariesTopic :: Utilities |
Evidence: django_redis-7.0.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “django redis cache backend”
- django-redisProvides a Redis cache and session backend for Django, supporting…
- django-cache-urlConfigures Django cache backends from environment variables using the…
- django-valkeyProvides a Valkey cache and session backend for Django, allowing you…
Give your agent the search over MCP, or paste the wish link into any chat.
More Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
See also django-cache-url · django-redis-sessions · django-valkey · django-cacheops · walrus · cashews · Beaker · pyramid-session-redis · django-constance · aiocache