基础文件更新一下配置

This commit is contained in:
jianqi
2026-09-12 13:59:38 +08:00
parent 641af3d126
commit 5078d4d0c9
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ from sqlalchemy.orm import sessionmaker
# 1. 配置 MySQL 数据库连接 URL
# 格式:mysql+pymysql://用户名:密码@主机:端口/数据库名?编码
# 请将下面的 'root', '123456', 'localhost', '3306', 'test_db' 替换为你自己的实际信息
SQLALCHEMY_DATABASE_URL = "mysql+pymysql://root:123456@localhost:3306/test_db"
SQLALCHEMY_DATABASE_URL = "mysql+pymysql://root:123456@localhost:3306/max_code_sms"
# 2. 创建数据库引擎
# - pool_pre_ping=True 表示每次从连接池取出连接前先 ping 一下,防止使用已断开的连接
+1 -1
View File
@@ -41,7 +41,7 @@ async def root():
if __name__ == "__main__":
import uvicorn
uvicorn.run(
"main6:app", # 指定应用位置(模块名:应用变量名)
"main:app", # 指定应用位置(模块名:应用变量名)
host="localhost", # 监听所有网络接口
port=8001, # 端口
reload=True # 开发模式,代码变动自动重启