python.py 文件源码

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

项目:PyPlanet 作者: PyPlanet 项目源码 文件源码
def load(self):
        # Make sure we load the defaults first.
        super().load()

        # Prepare the loading.
        self.module = os.environ.get('PYPLANET_SETTINGS_MODULE')

        if not self.module:
            raise ImproperlyConfigured(
                'Settings module is not defined! Please define PYPLANET_SETTINGS_MODULE in your '
                'environment or start script.'
            )

        # Add the module itself to the configuration.
        self.settings['SETTINGS_MODULE'] = self.module

        # Load the module, put the settings into the local context.
        module = importlib.import_module(self.module)

        for setting in dir(module):
            if setting.isupper():
                self.settings[setting] = getattr(module, setting)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号