cli.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:rq-scheduler-dashboard 作者: lamflam 项目源码 文件源码
def make_flask_app(config, username, password, url_prefix):
    """Return Flask app with default configuration and registered blueprint."""
    app = Flask(__name__)

    # Start configuration with our built in defaults.
    app.config.from_object(default_settings)

    # Override with any settings in config file, if given.
    if config:
        app.config.from_object(importlib.import_module(config))

    # Override from a configuration file in the env variable, if present.
    if 'RQ_SCHEDULER_DASHBOARD_SETTINGS' in os.environ:
        app.config.from_envvar('RQ_SCHEDULER_DASHBOARD_SETTINGS')

    # Optionally add basic auth to blueprint and register with app.
    if username:
        add_basic_auth(blueprint, username, password)
    app.register_blueprint(blueprint, url_prefix=url_prefix)

    return app
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号