From 3a01b98860647f4c884f63173a723e250faf353f Mon Sep 17 00:00:00 2001 From: maoshen Date: Sun, 12 Apr 2026 21:59:43 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B7=BB=E5=8A=A0=20psycopg2-binary=20?= =?UTF-8?q?=E5=92=8C=20gunicorn=20=E5=88=B0=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加 PostgreSQL 驱动 psycopg2-binary - 添加 gunicorn 生产服务器 --- city-manual/backend/requirements.txt | 2 ++ city-manual/scripts/deploy-to-cloud.sh | 2 +- city-manual/scripts/deploy-via-rsync.sh | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/city-manual/backend/requirements.txt b/city-manual/backend/requirements.txt index 73c422c..d63b156 100644 --- a/city-manual/backend/requirements.txt +++ b/city-manual/backend/requirements.txt @@ -3,3 +3,5 @@ djangorestframework djangorestframework-simplejwt django-cors-headers Pillow +psycopg2-binary +gunicorn diff --git a/city-manual/scripts/deploy-to-cloud.sh b/city-manual/scripts/deploy-to-cloud.sh index d970469..32ccd8a 100755 --- a/city-manual/scripts/deploy-to-cloud.sh +++ b/city-manual/scripts/deploy-to-cloud.sh @@ -6,7 +6,7 @@ set -e # 配置 SERVER_HOST="cssc.datalibstar.com" -SERVER_USER="mashen" +SERVER_USER="ubuntu" SERVER_PASS="825670@MashenClaw" PROJECT_PATH="/root/.openclaw/workspace/city-manual" diff --git a/city-manual/scripts/deploy-via-rsync.sh b/city-manual/scripts/deploy-via-rsync.sh index 6b3a983..198d1d9 100755 --- a/city-manual/scripts/deploy-via-rsync.sh +++ b/city-manual/scripts/deploy-via-rsync.sh @@ -58,7 +58,7 @@ pip install -r requirements.txt -q pip install gunicorn -q echo "🗄️ 配置环境变量..." -cd /home/ubuntu/city-manual +cd /home/ubuntu/city-manual/backend cat > .env << EOF DJANGO_SETTINGS_MODULE=config.settings.production DJANGO_SECRET_KEY=cssc-secret-key-$(date +%s) @@ -70,8 +70,8 @@ STATIC_ROOT=/home/ubuntu/city-manual/backend/static EOF echo "📦 数据库迁移..." -cd backend -source ../venv/bin/activate +cd /home/ubuntu/city-manual/backend +source venv/bin/activate python manage.py migrate --noinput python manage.py collectstatic --noinput