Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

MultiThreaded MultiServers Redis Extension for Flask Applications

Project Description

Flask-Multi-Redis

CI Status

PyPI Status


Adds Redis support to Flask with fail-over or aggregation capabilities.

Mostly inspired by these projects :

Built on top of redis-py.

Contributors

Description

Flask-Multi-Redis allows you to easily access multiple Redis servers from Flask applications. It supports SSL connections and password authentication. It’s not intended to implement all Redis commands but gives you the hability to make multi-threaded parallel queries to multiple Redis servers without the need to deploy a Redis cluster.

Installation

pip install flask-multi-redis

Configuration

Enable Flask-Multi-Redis in your application :

from flask import Flask
from flask.ext.redis import FlaskRedis

app = Flask(__name__)
redis_store = FlaskRedis(app)

Flask-Multi-Redis provide a simple flexible configuration handling. It reads its configuration from your Flask app.config dictionnary.

Default configuration for all servers :

app.config['REDIS_DEFAULT_PORT'] = 6379
app.config['REDIS_DEFAULT_DB'] = 0
app.config['REDIS_DEFAULT_PASSWORD'] = None
app.config['REDIS_DEFAULT_SOCKET_TIMEOUT'] = 5
app.config['REDIS_DEFAULT_SSL'] = None

Usage

FlaskMultiRedis proxies attribute access to an underlying Redis connection. So treat it as if it were a regular Redis instance.

@app.route('/')
def index():
    return redis_store.get('potato', 'Not Set')

Protip: The redis-py package currently holds the ‘redis’ namespace, so if you are looking to make use of it, your Redis object shouldn’t be named ‘redis’.

For detailed instructions regarding the usage of the client, check the redis-py documentation.

Advanced features, such as Lua scripting, pipelines and callbacks are detailed within the projects README.

Contribute

History

0.1.4 (2016-09-02)

  • Correct an error in aggregated put method

0.1.3 (2016-09-02)

  • Correct an error in aggregated delete method

0.1.2 (2016-09-02)

  • Correct an error in aggregated keys method

0.1.1 (2016-09-02)

  • Add scan_iter aggregated method

0.1.0 (2016-08-26)

  • First Beta : Now 100% covered

0.0.2 (2016-07-20)

  • First pre-release after some cleanup

0.0.1 (2016-07-20)

  • Initial commit
Release History

Release History

This version
History Node

0.1.5

History Node

0.1.4

History Node

0.1.3

History Node

0.1.2

History Node

0.1.1

History Node

0.1.0

History Node

0.0.3

History Node

0.0.2

History Node

0.0.1

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
Flask-Multi-Redis-0.1.5.tar.gz (30.1 kB) Copy SHA256 Checksum SHA256 Source Nov 22, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting