def get_settings_name():
"""
Gets the correct module to define Django's settings
"""
# application_id -> settings file
APPENGINE_PRODUCTION = os.getenv('SERVER_SOFTWARE', '').startswith(
'Google App Engine')
settings_map = {
'greenday-project-v02-dev': 'greenday_core.settings.staging',
'greenday-project-v02-potato': 'greenday_core.settings.potato',
'greenday-project': 'greenday_core.settings.prod',
}
try:
app_id = get_application_id().lower()
except AttributeError:
app_id = ''
settings_module = settings_map.get(app_id) \
if APPENGINE_PRODUCTION else 'greenday_core.settings.local'
logging.info("Using settings: {0}".format(settings_module))
return settings_module
评论列表
文章目录