def create_app(cache):
app = Flask(__name__, static_url_path='')
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///pong.db'
cache.init_app(app)
compress.init_app(app)
Bootstrap(app)
db.init_app(app)
with app.app_context():
db.create_all()
admin = Admin(app, name='pongr', template_mode='bootstrap3')
admin.add_view(GameView(Game, db.session))
admin.add_view(DoublesView(DoublesGame, db.session))
admin.add_view(PlayerView(Player, db.session))
admin.add_view(RatingsView(Ratings, db.session))
return app, cache
评论列表
文章目录