Esempio n. 1
0
def create_app(key):
    app = Flask(__name__)

    app.config.from_object(settings.ENV_NAME.get(key))

    app.config['SECRET_KEY'] = '110'
    init_ext(app)
    return app
Esempio n. 2
0
def create_app(env):
    app = Flask(__name__)

    app.config.from_object(envs.get(env))
    init_ext(app)
    init_view(app)

    return app
Esempio n. 3
0
def create_app(env):
    app = Flask(__name__)
    CORS(app, resources=r'/*')
    init_ext(app)
    init_apis(app)
    app.config.from_object(envs.get(env))

    return app
Esempio n. 4
0
def create_app():

    app = Flask(__name__)
    app.config.from_object(setting.envs.get('develop'))
    init_blueprint(app)
    init_ext(app)

    return app
Esempio n. 5
0
def create_app(env):
    app = Flask(__name__)

    app.config.from_object(settings.ENV_SETTING.get(env.lower()))

    init_ext(app)

    return app
Esempio n. 6
0
def create_app(env):
    app = Flask(__name__, static_folder="../static")
    app.config.from_object(envs.get(env))

    init_ext(app)

    init_views(app)
    return app
Esempio n. 7
0
def create_app():
    app = Flask(__name__)
    app.config.from_object(settings.Config)

    # 初始化第三方插件
    init_ext(app)

    return app
Esempio n. 8
0
def create_app():
    app = Flask(__name__)
    # uri格式: 数据库+驱动://用户名:密码@主机:端口/库名
    app.config['SQLALCHEMY_DATABASE_URI'] = "sqlite:///sqlite.db"
    app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
    init_ext(app)
    init_views(app)
    return app
Esempio n. 9
0
def create_app(env_name='default'):

    app = Flask(__name__)
    init_app(app,env_name)
    init_ext(app)
    init_api(app)

    return app
Esempio n. 10
0
def create_app(envname):
    app = Flask(__name__)

    app.config.from_object(settings.ENV_NAME.get(envname))

    init_ext(app)

    return app
Esempio n. 11
0
def create_app():
    app = Flask(__name__)
    app.config.from_object(settings.envs.get("develop"))

    init_ext(app)
    init_api(app)

    return app
Esempio n. 12
0
def create_app(env_name):
    app = Flask(__name__)
    app.config.update(RESTFUL_JSON=dict(ensure_ascii=False))
    app.config.from_object(settings.env.get(env_name))
    init_ext(app)
    init_apis(app)
    init_cache(app)
    return app
Esempio n. 13
0
def create_app(name):
    app = Flask(__name__)
    app.config.from_object(setting.ENV_NAME.get(name))
    app.debug = True
    init_ext(app, name)
    app.config.update(RESTFUL_JSON=dict(ensure_ascii=False))
    add = Indexpic()
    return app
Esempio n. 14
0
def create_app():
    app = Flask(__name__)
    app.register_blueprint(blue)
    # uri数据库+驱动://用户 名:密码@主机:端口/具体哪一个库
    app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+pymysql://root:[email protected]:3306/flask_test'
    # 保持兼容性
    app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
    init_ext(app=app)
    return app
Esempio n. 15
0
def create_app(env_name):
    app = Flask(__name__)
    app.config.from_object(settings.env.get(env_name or "default"))

    init_ext(app)

    init_blue(app=app)

    return app
Esempio n. 16
0
def create_app():
    app = Flask(__name__)
    # 初始化配置
    app.config.from_object(envs.get('develop'))
    # 注册蓝图,初始化蓝图
    init_blue(app)
    # 初始化第三方插件
    init_ext(app)
    return app
Esempio n. 17
0
def create_app():
    app = Flask(__name__,template_folder='../templates',static_folder='../static')
    #
    app.config.from_object(envs.get('develop'))

    init_first_blue(app)
    init_ext(app)

    return app
Esempio n. 18
0
def create_app():
    app = Flask(__name__)
    #url全格式  数据库+驱动://用户名:密码@主机:端口/具体哪个库
    app.config['SQLALCHEMY_DATABASE_URI'] = "sqlite:///sqlite.db"
    app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False

    init_ext(app)
    init_view(app)
    return app
Esempio n. 19
0
def create_app(env):
    app = Flask(__name__)
    # 加载配置
    app.config.from_object(envs.get(env))
    # 初始化第三方扩展库
    init_ext(app=app)
    # 初始化路由
    init_view(app=app)

    return app
Esempio n. 20
0
def create_app():
    app = Flask(__name__)

    app.config.from_object(envs.get("develop"))

    init_first_blue(app)

    init_ext(app)

    return app
Esempio n. 21
0
def create_app(env):
    app = Flask(__name__,
                static_folder='../static',
                template_folder='../templates')

    app.config.from_object(envs.get(env))
    init_ext(app)
    init_api(app)

    return app
Esempio n. 22
0
def init_app(env):
    app=Flask(__name__)
    #设置文件
    app.config.from_object(envs.get(env))
    #设置扩展库
    init_ext(app)
    #设置views,apis
    init_api(app)

    return app
Esempio n. 23
0
def create_app(ENV_NAME):
    app = Flask(__name__)
    CORS(app, supports_credentials=True)
    app.config.from_object(settings.env.get(ENV_NAME))
    #当浏览器显示中文乱码的时候  那么需要加这个忽略编码格式
    app.config.update(RESTFUL_JSON=dict(ensure_ascii=False))
    app.config['JSON_AS_ASCII'] = False
    init_ext(app)
    init_apis(app)
    return app
Esempio n. 24
0
def create_app(env):
    app = Flask(__name__, static_folder='.')
    app.config.from_object(envs.get(env))

    # 初始化ext
    init_ext(app)

    # 初始化views
    init_views(app)
    return app
Esempio n. 25
0
def create_app(env_name=None):
    app = Flask(__name__)

    init_config(app, env_name)

    init_ext(app)

    init_api(app)

    return app
Esempio n. 26
0
def create_app():
    app = Flask(__name__, template_folder=TEMPLATE_FOLDER)

    init_first_blue(app)

    init_ext(app)

    app.config.from_object(envs.get("develop"))

    return app
Esempio n. 27
0
def create_app(env):
    app = Flask(__name__)

    # 初始化项目配置
    app.config.from_object(envs.get(env))

    # 初始化扩展库
    init_ext(app)
    init_api(app)
    return app
Esempio n. 28
0
def create_app():
    app = Flask(__name__)
    app.register_blueprint(blue)
    # uri数据库+驱动://用户名:密码@主机:端口/具体哪一个库
    #app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+pymysql://root:[email protected]:3306/flask_test'
    # 保持兼容性
    #app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True
    app.config.from_object(envs.get("develop"))
    init_ext(app=app)
    return app
Esempio n. 29
0
def create_app(env):
    app = Flask(__name__)
    #初始化配置文件
    app.config.from_object(envs.get(env))
    # 初始化视图
    init_view(app)
    # 初始化第三方插件
    init_ext(app)

    return app
Esempio n. 30
0
def create_apps(ENV_NAME):
    app = Flask(__name__)

    # 选择开发环境以及数据库的选择和配置
    app.config.from_object(settings.env.get(ENV_NAME))

    # 第三方库的整合
    init_ext(app=app)

    return app