--- id: django-valkey version: "0.4.1" license: BSD-3-Clause license_treatment: permissive maintenance: active --- # django-valkey — a valkey backend for django License: permissive · Maintenance: active · Downloads: 77.7K/mo ## 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 above — verify before relying. Provides a Valkey cache and session backend for Django, allowing you to use Valkey as a drop-in replacement for Django's default caching and session storage. 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 pip install django-valkey uv add django-valkey poetry add django-valkey ## Installing django-valkey 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. 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') Requires a running Valkey server (7.2.6+) accessible at the configured location; also requires Python 3.10+ and Django 4.2.20+. 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_current - Install friction: low - Maintenance: active - Downloads: 77.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags django cache backend valkey, valkey session storage django, redis alternative django caching, django key-value store, valkey django integration, distributed cache django, django async cache, django-integration, caching-backend, session-storage [View on SkillFed](https://skillfed.io/packages/django-valkey) · [View on PyPI](https://pypi.org/project/django-valkey/)