This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Help us improve Python packaging - Donate today!
Project Description

Flask-Redislite

Using Flask with Redislite, also redis-collections.

Installation

Using pip

pip install Flask-Redislite

Usage

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

REDISLITE_PATH = '<path/to/redis/file.rdb>'

Create new redis instance within your application

from flask import Flask
from flask_redislite import FlaskRedislite

app = Flask(__name__)

rdb = FlaskRedislite(app)
# with redis-collections:
# rdb = FlaskRedislite(app, collection = True)

Then use it on your view

rdb.connection.set('foo1', 'bar1')
print rdb.connection.get('foo1')

# redis-collections
collection = rdb.collection
d = collection.dict('123456')
d['foo'] = 'bar'
print d

RQ

To use Flask-Redislite with RQ, you need to start RQ worker as a new process

from flask import Flask
from flask_redislite import FlaskRedislite

app = Flask(__name__)

rdb = FlaskRedislite(app, rq=True)

# Your other extensions load here
# ex: lm = LoginManager()
# ...

with app.app_context():
    rdb.start_worker()

# your codes
# ex: views function

app.run()

Then within your view enqueue the jobs:

import time

def simple_job():
    time.sleep(2)
    return 12345

queue = rdb.queue
queue.enqueue(simple_job, ttl=60, result_ttl=60, job_id='321')
sleep(5)
print queue.fetch_job('321').result

History

0.0.5 (9/7/2016)

  • Better test coverage
  • Apply PEP8
  • Resume lost Redislite process on restart, interrupted exit

0.0.4 (6/7/2016)

  • Add test

0.0.3 (5/7/2016)

  • Implement RQ

0.0.2 (3/7/2016)

  • Add documents
  • Fix minor codes

0.0.1 (2/7/2016)

  • Initial package
  • Allow to use Redislite and redis-collections from Flask
Release History

Release History

0.1.0rc0

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.0.5

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.0.4

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.0.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.0.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.0.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

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_Redislite-0.0.5-py2-none-any.whl (5.9 kB) Copy SHA256 Checksum SHA256 py2 Wheel Jul 9, 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