Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
因为老大说打算基于 Flask 开发 FeedBundle,我就建立了一个基于 Flask 的基本项目布局。和 Flask 官方建议的 Application Factory 方式有点相像,不过我是直接继承扩展了 flask.Flask 作为全局 Application。有以下内容:
除此之外就是一些非常细微的方便开发的东西,比如给 Flask 内置的 logger 添加了一个记录文件日志的 Logging Handler;再比如用 Flask-Script 构建了一个快速管理应用的脚本,以后如果引入了 Flask-SQLAlchemy 一类的插件可以更方便地执行 Database Migration。
这种应用布局是我个人的习惯,在此之前我用 Flask 开发应用也是这么用的。因为不确定大家是否接受这种方式,所以我没有直接 push 到 develop 分支,而是以 Pull Request 的方式给大家评价一下,希望大家看看是否可行。