modify scripts
This commit is contained in:
@ -9,4 +9,9 @@ db_config = {
|
|||||||
'database': 'stockdb'
|
'database': 'stockdb'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# 读取环境变量,来修改 db_config 中host的值
|
||||||
|
if 'DB_HOST' in os.environ:
|
||||||
|
db_config['host'] = os.environ['DB_HOST']
|
||||||
|
|
||||||
|
|
||||||
global_db_url = f"mysql+pymysql://{db_config['user']}:{db_config['password']}@{db_config['host']}:3306/{db_config['database']}?charset=utf8mb4"
|
global_db_url = f"mysql+pymysql://{db_config['user']}:{db_config['password']}@{db_config['host']}:3306/{db_config['database']}?charset=utf8mb4"
|
||||||
Reference in New Issue
Block a user