This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Yet another Redis extension for Flask. Flask-Redis-Helper doesn’t break PyCharm autocomplete/inspections and handles the Flask application context the same way SQLAlchemy does.

  • Python 2.6, 2.7, 3.3, and 3.4 supported on Linux and OS X.
  • Python 2.7, 3.3, and 3.4 supported on Windows (both 32 and 64 bit versions of Python).

Attribution

Inspired by Flask-SQLAlchemy and Flask-And-Redis.

Supported Platforms

  • OSX and Linux.
  • Python 2.6, 2.7, 3.3, 3.4
  • Flask 0.10.1
  • Redis 2.9.1
  • Celery 3.1.11

Quickstart

Install:

pip install Flask-Redis-Helper

Example:

from flask import Flask
from flask.ext.redis import Redis

app = Flask(__name__)
app.config['REDIS_URL'] = 'redis://localhost'
redis = Redis(app)

Factory Example

# extensions.py
from flask.ext.redis import Redis

redis = Redis()
redis_cache = Redis()
# application.py
from flask import Flask
from extensions import redis, redis_cache

def create_app():
    app = Flask(__name__)
    app.config['REDIS_URL'] = 'redis://localhost/0'
    app.config['REDIS_CACHE_URL'] = 'redis://localhost/1'
    redis.init_app(app)
    redis_cache.init_app(app, config_prefix='REDIS_CACHE')
    return app
# manage.py
from application import create_app

app = create_app()
app.run()

Configuration

Flask-Redis-Helper subclasses StrictRedis and adds the init_app() method for delayed initialization (for applications that instantiate extensions in a separate file, but run init_app() in the same file Flask() was instantiated).

The following config settings are searched for in the Flask application’s configuration dictionary:

  • REDIS_URL – URL to Redis server. May be a network URL or Unix socket URL. Individual components may be overridden by settings below (like setting REDIS_DB). URLs must start with redis://, file://, or redis+socket:// (Celery compatibility). redis:// handles ambiguous URLs (like redis://localhost and redis://my_socket_file) by prioritizing network URL interpretations over socket URLs. Use the file:// or redis+socket:// URL schemes to force socket URL interpretations over network URLs.
  • REDIS_SOCKET – UNIX socket file path. If specified, disables REDIS_HOST and REDIS_PORT settings.
  • REDIS_HOST – the Redis server’s hostname/IP. Default is localhost.
  • REDIS_PORT – TCP port number. Default is 6379.
  • REDIS_PASSWORD – password. Default is None.
  • REDIS_DB – DB instance (e.g. 1). Must be an integer. Default is 0.

Changelog

1.0.0

  • Windows support.
  • Removed dependency on six.

0.1.3

  • Support trailing slashes.

0.1.2

  • Minor code restructuring.

0.1.1

  • Added Python 2.6 and 3.x support.

0.1.0

  • Initial release.
Release History

Release History

1.0.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
Flask-Redis-Helper-1.0.0.tar.gz (6.8 kB) Copy SHA256 Checksum SHA256 Source Dec 23, 2014

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