Files
aitsc/run_production.py
renjianbo ba73f8395a chore: add project analysis doc, clean up legacy scripts, update docs
- Add comprehensive project analysis document (项目分析文档.md)
- Add Windows startup guide and batch script
- Replace legacy startup scripts with run_production.py (Waitress)
- Remove deprecated bat scripts and duplicate run files
- Update .env.example, README.md, and docs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-03 08:55:43 +08:00

37 lines
891 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env python3
"""生产环境启动Waitress WSGIWindows 友好)。说明见仓库根目录 windows上唯一启动说明.md。"""
import os
import sys
from waitress import serve
from src.flask_prompt_master import create_app
def main() -> None:
os.environ.setdefault("FLASK_ENV", "production")
app = create_app()
port = int(os.environ.get("PORT", "5000"))
print("=" * 60)
print("Flask 提示词大师 - 生产环境 (Waitress)")
print("=" * 60)
print(f"监听: 0.0.0.0:{port} 按 Ctrl+C 停止")
print("=" * 60)
serve(
app,
host="0.0.0.0",
port=port,
threads=4,
connection_limit=1000,
cleanup_interval=30,
channel_timeout=120,
max_request_body_size=1073741824,
)
if __name__ == "__main__":
try:
main()
except KeyboardInterrupt:
sys.exit(0)