python web app with redis github

Solutions on MaxInterview for python web app with redis github by the best coders in the world

showing results for - "python web app with redis github"
Luciana
05 Sep 2018
1from flask import Flask
2from flask_redis import FlaskRedis
3from mockredis import MockRedis
4
5
6def create_app():
7    app = Flask(__name__)
8    if app.testing:
9        redis_store = FlaskRedis.from_custom_provider(MockRedis)
10    else:
11        redis_store = FlaskRedis()
12    redis_store.init_app(app)
13    return app