This commit is contained in:
27942
2025-12-01 17:22:53 +08:00
parent 33d1c2cae5
commit 1d3e26f519
13 changed files with 1243 additions and 41 deletions

23
models/__init__.py Normal file
View 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']
)