def __init__(self, configfile='.env'):
'''Initialize.
@param: configfile a .env style config file. See README for more.
'''
if os.path.exists(configfile):
# we set ourselves as load_dotenv has system env variables to take
# precedence which in our experience is confusing as a user changes a
# var and re-runs and nothing happens
# dotenv.load_dotenv('.env')
out = dotenv.main.dotenv_values(configfile)
# we need stuff in the environment for docker
os.environ.update(out)
self.config = os.environ
rds_uri = self.config.get('RDS_URI')
if not rds_uri:
print('Warning: RDS_URI is not set. please set, or run `python main.py rds`')
评论列表
文章目录