django-valkey
a valkey backend for django
Decision gist · record as of 2026-08-14
Yes, if you are running Django 4.2.20+ or 5.2+ on Python 3.10+ and have a Valkey server available. The package is actively maintained, has low install friction, carries no known vulnerabilities, and offers a production-ready alternative to in-memory or database-backed caching. Avoid it only if you are locked into Django 5.0 or 5.1, or if you require Redis specifically rather than Valkey.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires a running Valkey server (7.2.6+) accessible at the configured location; also requires Python 3.10+ and Django 4.2.20+.
- Low friction installation with a pure-Python wheel.
- Actively maintained as of August 2026 with recent commits and 81 repository stars.
License · maintenance · safety
BSD-3-Clause (permissive) — BSD-3-Clause permissive license allows commercial and private use with minimal restrictions; you must retain copyright notices and the license text in distributions.
last release 2026-05-06 (100 days) · last repo commit 2026-08-10 · 81 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 77,734 downloads/mo, #14,502 on PyPI
Alternatives
Verify before relying
pip install django-valkey
# In Django settings.py:
CACHES = {
'default': {
'BACKEND': 'django_valkey.cache.ValkeyCache',
'LOCATION': 'valkey://localhost/1',
}
}
# Then use Django's cache API:
from django.core.cache import cache
cache.set('key', 'value')- Whether async cache operations are fully production-ready or still experimental.
- Performance characteristics compared to the original django-redis project it forked from.
- Stability of pluggable serializer and parser interfaces across minor versions.
What it is and what it does
django-valkey is a BSD-licensed cache and session backend that integrates Valkey (a free, well-maintained key-value store) into Django. It is a fork of django-redis and reuses its mature design while targeting Valkey instead of Redis. The package provides native support for Valkey's connection strings, async operations, pluggable clients and serializers, primary/secondary replication, Unix sockets, and infinite timeouts. It has been used in production for caching and session storage and includes a comprehensive test suite.
You configure it in Django settings by specifying a Valkey location URL and then use Django's standard cache API to interact with Valkey transparently. The package is highly configurable—you can emulate memcached exception behavior, choose compression algorithms (lz4, zstd, brotli), and select alternative serializers (msgpack, msgspec) via optional extras. It requires Python 3.10+, Django 4.2.20 or later (but not 5.0 or 5.1), and Valkey server 7.2.6+.
Use it for
- Replace Django's default in-memory cache with a persistent, distributed Valkey backend for multi-process or multi-server deployments.
- Store Django session data in Valkey instead of the database to reduce database load and improve session performance.
- Use async cache operations in Django async views and middleware for non-blocking cache access.
- Configure primary/secondary Valkey nodes for cache redundancy and read scaling.
- Integrate custom serializers or compression algorithms to optimize cache storage and network bandwidth.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are running Django 4.2.20+ or 5.2+ on Python 3.10+ and have a Valkey server available.
The package is actively maintained, has low install friction, carries no known vulnerabilities, and offers a production-ready alternative to in-memory or database-backed caching. Avoid it only if you are locked into Django 5.0 or 5.1, or if you require Redis specifically rather than Valkey.
Install
django-valkey on PyPI
Before you install
Low friction installation with a pure-Python wheel. Actively maintained as of August 2026 with recent commits and 81 repository stars. Requires Django 4.2.20+ and Python 3.10+; note that Django 5.0 and 5.1 are explicitly unsupported due to end-of-life status.
Requires a running Valkey server (7.2.6+) accessible at the configured location; also requires Python 3.10+ and Django 4.2.20+.
License in practice
BSD-3-Clause permissive license allows commercial and private use with minimal restrictions; you must retain copyright notices and the license text in distributions.
Quickstart
pip install django-valkey
# In Django settings.py:
CACHES = {
'default': {
'BACKEND': 'django_valkey.cache.ValkeyCache',
'LOCATION': 'valkey://localhost/1',
}
}
# Then use Django's cache API:
from django.core.cache import cache
cache.set('key', 'value')
Verify before relying
- Whether async cache operations are fully production-ready or still experimental.
- Performance characteristics compared to the original django-redis project it forked from.
- Stability of pluggable serializer and parser interfaces across minor versions.
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 packagesdjangotyping-extensionsvalkey |
| Maintenance | Actively maintained 100 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 77,734 / month, #14,502 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaEnvironment :: Web EnvironmentFramework :: Django :: 4.2Framework :: Django :: 5.2Framework :: Django :: 6.0Intended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating 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_valkey-0.4.1-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 cache backend valkey”
- django-valkeyProvides a Valkey cache and session backend for Django, allowing you…
- cachelibCacheLib provides a unified API for interacting with multiple cache…
- langgraph-checkpoint-awsProvides AWS-based persistence backends for LangGraph agents,…
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-redis · valkey · django-cache-url · libvalkey · cachelib · aiocache · opentelemetry-python-contrib-external-valkey · valkey-glide · fakeredis · django-constance