超级管理员登录设置

This commit is contained in:
dxc
2026-02-04 13:30:07 +08:00
parent 4aa43a0607
commit 13590b1fac
21 changed files with 881 additions and 104 deletions

View File

@ -1,12 +1,14 @@
# 文件路径: run.py (在项目根目录下,与 config.py 同级)
# inventory-backend/run.py
from app import create_app
# 【关键】这一行必须在最外层,不能放在 if __name__ ... 里面!
# Gunicorn 会导入这个变量
app = create_app()
if __name__ == '__main__':
# debug=True 修改代码后会自动重启
# 这里是开发调试用的Docker/Gunicorn 不会执行这里
print("\n====== 当前所有注册路由 ======")
for rule in app.url_map.iter_rules():
print(f"{rule} -> {rule.endpoint}")
print("==============================\n")
app.run(host='0.0.0.0', port=5000, debug=True)
app.run(host='0.0.0.0', port=8000, debug=True)