def init_ext(app): # db.init_app(app) # migrate.init_app(app,db) init_db(app) init_api(app) mail.init_app(app) cache.init_app(app)
def create_app(): app = Flask(__name__) app.config.from_object(envs.get('develop')) init_ext(app) init_views(app) init_api(app) return app
def create_app(env): app = Flask(__name__) app.config.from_object(envs.get("develop")) init_extend(app) init_api(app=app) load_middleware(app) return app
def create_app(env): app = Flask(__name__, template_folder='../templates') #设置模板文件夹相对路径 app.config.from_object(envs.get(env)) init_ext(app) init_api(app) return app
def create_app(): app = Flask(__name__) # 初始化flask配置 app.config.from_object(envs.get('develop')) # 初始化 扩展库 init_ext(app) # 初始化蓝图 init_blueprint(app) init_api(app=app) return app
def create_app(env_name='default'): app = Flask(__name__) init_app(app, env_name) init_ext(app) init_api(app) return app
def create_app(cfg=None): app = Flask('osc') from config import config config_name = cfg or os.getenv('FLASK_CONFIG') or 'default' app.config.from_object(config[config_name]) db.init_app(app) from app.apis import init_app as init_api from app.default import init_app as init_default init_api(app) init_default(app) return app
def create_app(env_name='default'): app = Flask(__name__, template_folder='../templates', static_folder='../static' ) #加上template_folder属性才能访问模板文件,static_folder属性访问静态文件 #配置相关 init_setting(app, env_name) #插件相关 init_ext(app) #蓝图 init_views(app) #api init_api(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