def create_app(env_name='default'): app = Flask(__name__) init_app(app,env_name) init_ext(app) init_api(app) init_blue(app) return app
def create_app(env): app = Flask(__name__) app.config.from_object(envs.get(env)) init_ext(app) init_api(app) return app
def create_app(env): app = Flask(__name__, static_folder='../static') app.config.from_object(envs.get(env)) init_ext(app) init_api(app) return app
def init_ext(app): # 初始化数据库 init_db(app) # 初始化Api接口 init_api(app) # 初始化邮箱模块 mail.init_app(app) # 初始化缓存 cache.init_app(app)
def create_app(): app = Flask(__name__) # 初始化配置 app.config.from_object(cfg_obj) # 初始化扩展 init_ext(app) # 初始化API init_api(app) return app
def create_app(env): app = Flask(__name__) # 初始化配置 app.config.from_object(envs.get(env)) # 初始化扩展 init_ext(app) # 初始化API init_api(app) return app
def create_app(env_name=None): app = Flask(__name__) # 配置config init_cogfig(app, env_name) # 扩展ext init_ext(app) # api init_api(app) # 蓝图 init_blue(app) return app