Files
ai_wht_wechat/backend/start.sh
2026-01-06 19:36:42 +08:00

34 lines
829 B
Bash
Raw Permalink 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.

#!/bin/bash
# 小红书Python服务启动脚本开发环境
# 用途:前台启动,方便查看日志
cd "$(dirname "$0")"
echo "========================================"
echo " 小红书登录服务(开发模式)"
echo "========================================"
echo ""
# 激活虚拟环境
echo "[环境] 激活虚拟环境: $(pwd)/venv"
source venv/bin/activate
if [ $? -ne 0 ]; then
echo "[错误] 虚拟环境激活失败"
exit 1
fi
# 显示Python版本和路径
echo "[Python] $(python --version)"
echo "[路径] $(which python)"
echo ""
echo "[启动] 正在启动Python服务端口8000..."
echo "[说明] 按Ctrl+C停止服务"
echo ""
# 设置环境为开发环境
export ENV=dev
# 启动服务开发模式不使用reload
python -m uvicorn main:app --host 0.0.0.0 --port 8000