base.py 文件源码

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

项目:minimum-entropy 作者: DistrictDataLabs 项目源码 文件源码
def environ_setting(name, default=None):
    """
    Fetch setting from the environment- if not found, then this setting is
    ImproperlyConfigured.
    """
    if name not in os.environ and default is None:
        from django.core.exceptions import ImproperlyConfigured
        raise ImproperlyConfigured(
            "The {0} ENVVAR is not set.".format(name)
        )

    return os.environ.get(name, default)


##########################################################################
## Build Paths inside of project with os.path.join
##########################################################################

## Project is the location of the minent directory (with the wsgi.py)
## Note that BASE_DIR (originally in this file) is the same as Project
## Repository is the location of the project and the apps and other files
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号