skillfed

flask-redis

A nice way to use Redis in your Flask app

flask-redis v0.4.0 156.0K downloads/30d#10,795 on PyPI440
License unclear DORMANT released

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-redis

uv

uv add flask-redis

poetry

poetry add flask-redis

Installing 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

Development Status :: 4 - BetaEnvironment :: Web EnvironmentFramework :: FlaskIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: Implementation :: CPythonTopic :: Internet :: WWW/HTTP :: Dynamic ContentTopic :: Software Development :: Libraries :: Python Modules

Tags

flask redis integrationredis client for flaskflask extension redisredis caching flaskflask redis configuration
flask-extensionredis-client

More Python Modules packages