app.config.from_object

app.config.from_object这个方法用来加载配置文件

import config
app.config.from_object(config)

app.config.from_pyfile('config.py', silent=False)
#silent参数,默认为False,如果加载的配置文件不存在,则直接报错,如果改成True,则忽略,不报错。
原文地址:https://www.cnblogs.com/daicw/p/11690293.html