config.py 文件源码

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

项目:kaira 作者: mulonemartin 项目源码 文件源码
def from_object(self, obj):
        """Update the values from the given object.
        Objects are usually either modules or classes.
        Just the uppercase variables in that object are stored in the config.
        Example usage::
            from yourapplication import default_config
            app.config.from_object(default_config)
        You should not use this function to load the actual configuration but
        rather configuration defaults. The actual config should be loaded
        with :meth:`from_pyfile` and ideally from a location not within the
        package because the package might be installed system wide.
        :param obj: an object holding the configuration
        """
        for key in dir(obj):
            if key.isupper():
                self[key] = getattr(obj, key)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号