flask-redis
A nice way to use Redis in your Flask app
What it is and what it does
flask-redis is a Flask extension that wraps the redis-py library, allowing you to configure and use a Redis client within a Flask application using Flask's standard configuration system. Instead of manually instantiating and managing a redis-py client, you declare a FlaskRedis instance and configure it with a REDIS_URL, and the extension handles the connection lifecycle and makes the client available throughout your app.
The package acts as a thin, Flask-aware adapter over redis-py. It supports both direct initialization and the deferred init_app pattern common in Flask extensions, allows custom Redis providers (useful for swapping in mock implementations during testing), and passes through all redis-py methods and keyword arguments unchanged. You interact with it exactly like a standard redis-py client once initialized.
Use it for:
- Add Redis caching to a Flask web application with minimal boilerplate using Flask config.
- Use mock Redis via custom provider in tests while using real Redis in production.
- Support multiple Redis databases in a single Flask app via config_prefix.
- Access Redis from Flask route handlers and background tasks without manual connection management.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Integrates Redis into Flask applications as a managed extension, providing a Flask-aware client that wraps the redis-py library with configuration through Flask's config system.
Yes, with conditions. The package is simple, well-documented, and has no known vulnerabilities. Install friction is low and it integrates cleanly with Flask's extension pattern. However, it has been dormant since 2019 and the license is undeclared—verify that the unclear license status is acceptable for your use case, and be aware that bug fixes or updates may be slow. If you need active maintenance or modern Python support guarantees, consider whether a direct redis-py integration or a more actively maintained alternative better suits your project.
Install
flask-redis on PyPI
pip
pip install flask-redisuv
uv add flask-redispoetry
poetry add flask-redisInstalling flask-redis
Before you install
Low install friction with only two runtime dependencies (Flask and redis). However, the package is dormant—last release was 2019-05-29, with the most recent commit in 2024-03-04. No active maintenance; the sole maintainer works full-time and response times may be slow.
License in practice
License treatment is unclear—the package metadata does not specify a license. The description notes that earlier work was Apache 2 licensed, but the current license status is not documented in the package metadata.
Quickstart
pip install flask-redis
from flask import Flask
from flask_redis import FlaskRedis
app = Flask(__name__)
app.config['REDIS_URL'] = 'redis://localhost:6379/0'
redis_client = FlaskRedis(app)
value = redis_client.get('key')
Requires a running Redis server; connection URL must be configured via Flask's REDIS_URL config variable.
Verify before relying
- Whether the package works reliably with modern Flask and redis versions despite dormancy since 2019.
- Current compatibility with Python versions beyond 3.7 (classifiers list only up to 3.7).
- Whether the unclear license status poses any legal risk for commercial use.
Package facts
| License | not declared (unclear) |
| Python support | supports the current Python release (>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — Flask, redis |
| Maintenance | dormant — 2,634 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 156,039/month — #10,795 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: flask_redis-0.4.0-py2.py3-none-any.whl
Keywords: flask, redis
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
redis-cliProvides a lightweight wrapper around redis-py…
permissive · top 15,000 on PyPI
redisliteRedislite embeds a self-contained Redis server…
permissive · top 15,000 on PyPI
Flask-SessionFlask-Session adds server-side session storage…
permissive · top 5,000 on PyPI
walrusWalrus extends the redis-py client with…
unclear · top 15,000 on PyPI
py-redisA convenience wrapper around the official Redis…
permissive · top 15,000 on PyPI
redis-entraidProvides Entra ID (Azure Active Directory)…
unclear · top 5,000 on PyPI
redisPython client library for connecting to and…
permissive · top 1,000 on PyPI
hiredishiredis wraps the C hiredis library to parse…
permissive · top 1,000 on PyPI
fakeredisfakeredis provides an in-memory, pure-Python…
permissive · top 1,000 on PyPI
django-redis-sessionsProvides a Redis-backed session storage backend…
permissive · top 15,000 on PyPI