What is best way to interact with Redis in a Flask app? Do you just import Redis and ...
r = redis.Redis()
r.connect()
or is there an ORM or something I haven't seen yet?
Flask-And-Redis provides simple as dead support of Redis database for Flask applications. Extension built around beautiful redis-py library by Andy McCurdy. Works on Python 2.7, 3.4+ BSD licensed.
Flask is a good python web microframework which lets you focus only on things you need. There is more focus on the modularity of your code base. Redis is a key-value datastore that can be used as a database.
Redis is easier to use with Python if you have a code library client that bridges from your code to your Redis instace. The following libraries and resources provide more information on handling data in a Redis instance with your Python code. Redis-py is a solid Python client to use with Redis.
There is a lightweight Redis ODM available called Python stdnet:
http://lsbardel.github.com/python-stdnet/overview.html
Haven't tried it yet but looks good to me. Works with Python 2.6 to 3.3 according to the documentation.
Take a look at this extension that provides support for Redis in Flask:
https://github.com/playpauseandstop/Flask-And-Redis
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With