first commit

This commit is contained in:
rjb
2025-12-21 00:20:27 +08:00
commit 6fb3c6c23d
42 changed files with 2265 additions and 0 deletions

29
run_production.py Normal file
View File

@@ -0,0 +1,29 @@
#!/usr/bin/env python
"""
生产环境启动脚本
使用Gunicorn运行
"""
import os
from dotenv import load_dotenv
# 加载环境变量
load_dotenv()
# 设置生产环境
os.environ.setdefault('FLASK_ENV', 'production')
from src.your_app import create_app
app = create_app()
if __name__ == '__main__':
# 生产环境应该使用Gunicorn或uWSGI
# 此脚本仅用于测试
print("警告: 生产环境请使用Gunicorn运行")
print("命令: gunicorn -c gunicorn.conf.py 'src.your_app:create_app()'")
app.run(
host='0.0.0.0',
port=int(os.environ.get('PORT', 5000)),
debug=False
)