checks.py 文件源码

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

项目:django-gstorage 作者: fyndiq 项目源码 文件源码
def check_gstorage_params(**kwargs):
    """
    Check that the module is initialized with all the required settings/environment

    Args:
        kwargs: optional list of app_config

    Returns:
        A list of errors
    """
    errors = []
    module_name = 'gstorage'

    for index, field in enumerate(REQUIRED_SETTINGS):
        if not get_config(field):
            errors.append(
                checks.Error(
                    '%s is required' % field,
                    hint=None,
                    obj=module_name,
                    id='%s.00%s' % (module_name, index + 1)  # use 1-based index for errors
                )
            )
    return errors
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号