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(env): app = Flask(__name__) # app.config.from_object(envs.get(env)) init_ext(app) init_blue(app) init_api(app) return app
def create_app(): app = Flask(__name__) app.register_blueprint(blue) app.register_blueprint(second) app.register_blueprint(third) app.config.from_object(envs.get('testing')) init_ext(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): app = Flask(__name__) app.secret_key = "duansq" # 加载配置 app.config.from_object(envs.get(env)) # 初始化l路由 init_view(app=app) # 初始化第三方扩展库 init_ext(app=app) return app
def creat_app(): app = Flask(__name__, template_folder="../templates") #初始化app app.config.from_object(envs.get("develop")) #初始化蓝图 路由 init_first_blue(app) #初始化第三方库 init_ext(app) return app
def create_app(): app = Flask(__name__, static_folder="./../../dist/static", template_folder="./../../dist") cors = CORS(app, resources={r"/getList": {"origins": "*"}}) # 初始化配置 app.config.from_object(envs.get('develop')) # 注册蓝图,初始化蓝图 init_blue(app) # 初始化第三方插件和库 init_ext(app) return app
def create_app(): app = Flask(__name__) #配置使用开发环境 app.config.from_object(envs.get('develop')) #初始化蓝图-路由 init_home_blue(app) #初始化ext第三方类库 init_ext(app) return app
def create_app(): app = Flask(__name__, template_folder=settings.TEMPLATE_FOLDER) app.config.from_object(envs.get('develop')) app.config['SECRET_KEY'] = os.urandom(24) app.config['SESSION_TYPE'] = 'sqlalchemy' # session类型为sqlalchemy app.config['SESSION_SQLALCHEMY'] = db # SQLAlchemy对象 app.config['SESSION_SQLALCHEMY_TABLE'] = 'session' # session要保存的表名称 app.config['SESSION_PERMANENT'] = True # 如果设置为True,则关闭浏览器session就失效。 app.config['SESSION_USE_SIGNER'] = False # 是否对发送到浏览器上session的cookie值进行加密 app.config['SESSION_KEY_PREFIX'] = 'session:' # 保存到session中的值的前缀 # 初始化蓝图 init_blue(app) a_blue(app) # 初始化第三方插件、库 init_exts(app) return app