manage.py 文件源码

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

项目:pyt 作者: python-security 项目源码 文件源码
def update(settings=None, force=False):
    """Updates the settings via a fixture. All fixtures have to be placed
    in the `fixture`.
    Usage: python manage.py update -s your_fixture
    """

    try:
        fixture = import_string(
            "flaskbb.fixtures.{}".format(settings)
        )
        fixture = fixture.fixture
    except ImportError:
        raise "{} fixture is not available".format(settings)

    overwrite_group = overwrite_setting = False
    if force:
        overwrite_group = overwrite_setting = True

    count = update_settings_from_fixture(
        fixture=fixture,
        overwrite_group=overwrite_group,
        overwrite_setting=overwrite_setting
    )
    print("{} groups and {} settings updated.".format(
        len(count.keys()), len(count.values()))
    )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号