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
评论列表
文章目录