Adding Flask-Redis to the project.

[https://pypi.python.org/pypi/Flask-Redis/0.1.0](https://pypi.python.org/pypi/Flask-Redis/0.1.0)

Initial addition as we think about redis as cache.
This commit is contained in:
Martyn Inglis
2016-11-10 11:27:57 +00:00
parent 23cc37e2d1
commit eb94fe6c0a
6 changed files with 5 additions and 32 deletions

View File

@@ -1,22 +0,0 @@
import redis
class RedisClient:
def init_app(self, app, *args, **kwargs):
self.active = app.config.get('REDIS_ENABLED')
self.redis = None
if self.active:
self.redis = redis.StrictRedis(
app.config.get('REDIS_HOST'),
app.config.get('REDIS_PORT')
)
def set(self, key, value):
self.redis.set(key, value)
def get(self, key):
return self.redis.get(key)
def incr(self, key):
return self.redis.incr(key)