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