GitXplorerGitXplorer
d

Flask-Redistore

public
4 stars
1 forks
0 issues

Commits

List of commits on branch master.
Unverified
764f2db0820a31073990b098490223d62b08388b

Small version bump

ddstufft committed 12 years ago
Unverified
53d41bce8e70c262761041961d844c439ecde68a

Include tests, README.rst and LICENSE in the dist

ddstufft committed 12 years ago
Unverified
f128af67319c7e8b80547e0d2b463bbed8a22050

Add a Travis image

ddstufft committed 12 years ago
Unverified
8a6ece2db69d2e104927c117dcd9ddaf6f94e539

Remove 2.5

ddstufft committed 12 years ago
Unverified
a5c0efec6c00118fd4df8163b76e5ecca4355adb

Add pretend to the test requirements

ddstufft committed 12 years ago
Unverified
ca71201f0855ba13f2912de738c6657953f21810

Another small whitespace tweak

ddstufft committed 12 years ago

README

The README file for this repository.

Flask Redistore

.. image:: https://travis-ci.org/dstufft/Flask-Redistore.png :target: https://travis-ci.org/dstufft/Flask-Redistore

Adds Redis to your Flask Appliation.

Install

.. code:: bash

$ pip install Flask-Redistore

Usage

.. code:: python

import flask
from flask.ext.redistore import Redistore

app = flask.Flask(__name__)
app.config["REDIS_URI"] = "redis://:password@localhost/0"

redis = Redistore(app)
redis.set("My key", "the value!")
redis.get("My key")

Usage (advanced)

.. code:: python

import flask
import redis

from flask.ext.redistore import Redistore

redis = Redistore(redis_class=redis.StrictRedis)

def create_app(name=__name__):
    app = flask.Flask(name)
    app.config["REDIS_URI"] = "redis://:password@localhost/0"

    redis.init_app(app)

    return app

create_app()

redis.set("My new key", "Another Value!")
redis.get("My new key")