1.读取config.json中mysql地址。
This commit is contained in:
5
model.py
5
model.py
@@ -1,8 +1,11 @@
|
|||||||
from peewee import *
|
from peewee import *
|
||||||
import datetime
|
import datetime
|
||||||
|
import config
|
||||||
|
|
||||||
|
config.init_config()
|
||||||
|
mysql_addr = config.read_json()
|
||||||
mysql_db = MySQLDatabase(
|
mysql_db = MySQLDatabase(
|
||||||
"vps", user="dmy", password="abc123+_", host="zero.yoojoo.space", port=3306
|
"vps", user="dmy", password="abc123+_", host=mysql_addr, port=3306
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user