ggrg
This commit is contained in:
23
models/__init__.py
Normal file
23
models/__init__.py
Normal file
@@ -0,0 +1,23 @@
|
||||
import pymysql
|
||||
from peewee import MySQLDatabase
|
||||
|
||||
# 安装 pymysql 作为 MySQLdb
|
||||
pymysql.install_as_MySQLdb()
|
||||
|
||||
# 数据库配置
|
||||
db_config = {
|
||||
'database': 'lm',
|
||||
'user': 'lm',
|
||||
'password': 'phzEDrRDEeNZ7yFX',
|
||||
'host': '192.168.1.79',
|
||||
'port': 3306
|
||||
}
|
||||
|
||||
# 全局数据库实例
|
||||
db = MySQLDatabase(
|
||||
db_config['database'],
|
||||
user=db_config['user'],
|
||||
password=db_config['password'],
|
||||
host=db_config['host'],
|
||||
port=db_config['port']
|
||||
)
|
||||
Reference in New Issue
Block a user