fix: 添加 psycopg2-binary 和 gunicorn 到依赖
- 添加 PostgreSQL 驱动 psycopg2-binary - 添加 gunicorn 生产服务器
This commit is contained in:
@@ -3,3 +3,5 @@ djangorestframework
|
||||
djangorestframework-simplejwt
|
||||
django-cors-headers
|
||||
Pillow
|
||||
psycopg2-binary
|
||||
gunicorn
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user