models.py 文件源码

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

项目:pfb-network-connectivity 作者: azavea 项目源码 文件源码
def base_environment(self):
        """ Convenience method for copying the environment to hand to batch jobs """

        # Since we run django manage commands in the analysis container, it needs a copy of
        # all the environment variables that this app needs, most of which are conveniently
        # prefixed with 'PFB_'
        # Set these first so they can be overridden by job specific settings below
        environment = {key: val for (key, val) in os.environ.items()
                       if key.startswith('PFB_') and val is not None}
        # For the ones without the 'PFB_' prefix, send the settings rather than the original
        # environment variables because the environment variables might be None, which is not
        # acceptable as a container override environment value, but the settings values will be set
        # to whatever they default to in settings.
        environment.update({
            'DJANGO_ENV': settings.DJANGO_ENV,
            'DJANGO_LOG_LEVEL': settings.DJANGO_LOG_LEVEL,
            'AWS_DEFAULT_REGION': settings.AWS_REGION,
        })
        return environment
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号