Flask Redislite fun tech researching

Project Flask Redislite

Flask Redislite's avatar

Project's Website

What is Flask-Redislite

Flask-Redislite is a Flask extension to integrate Flask with Redislite, also integrated with redis-collections and rq.

Installation

Install Flask-Redislite using pip.

pip install Flask-Redislite

Choose the path for your Redislite data and pid file, then include to your application config.

REDISLITE_PATH = '<path/to/redislite/file.rdb>'
REDISLITE_WORKER_PID = '<path/to/redislite/file.pid>'

Create new redis instance within your application

from flask import Flask
from flask_redislite import FlaskRedis

app = Flask(__name__)

rdb = FlaskRedis(app)

@app.route("/")
def hello():
    rdb.connection.set('foo1', 'bar1')
    return rdb.connection.get('foo1')
    

Get code

Please visit project’s Github repository.

Comments