26 lines
575 B
Bash
26 lines
575 B
Bash
|
|
#!/bin/bash
|
|||
|
|
# 日记系统启动脚本
|
|||
|
|
|
|||
|
|
cd /root/.openclaw/workspace/diary-system/backend
|
|||
|
|
|
|||
|
|
# 安装依赖
|
|||
|
|
pip3 install -r requirements.txt -q
|
|||
|
|
|
|||
|
|
# 数据库迁移
|
|||
|
|
python3 manage.py makemigrations diary
|
|||
|
|
python3 manage.py migrate
|
|||
|
|
|
|||
|
|
# 收集静态文件
|
|||
|
|
python3 manage.py collectstatic --noinput
|
|||
|
|
|
|||
|
|
# 启动 Gunicorn
|
|||
|
|
echo "🚀 启动日记系统..."
|
|||
|
|
gunicorn diary_system.wsgi:application \
|
|||
|
|
--bind 127.0.0.1:8002 \
|
|||
|
|
--workers 3 \
|
|||
|
|
--daemon
|
|||
|
|
|
|||
|
|
echo "✅ 日记系统已启动"
|
|||
|
|
echo "📝 访问地址:http://127.0.0.1:8001/"
|
|||
|
|
echo "🔧 Admin: http://127.0.0.1:8001/admin/"
|