backend_start windows.ps1 643 B

123456789101112131415161718
  1. # GreaterWMS 后端启动脚本 (Windows PowerShell版本)
  2. # 此脚本会启动Django后端服务
  3. Write-Host "启动GreaterWMS后端服务..." -ForegroundColor Cyan
  4. # 获取脚本所在目录
  5. $ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
  6. Set-Location $ScriptDir
  7. # 执行数据库迁移
  8. Write-Host "执行数据库迁移..." -ForegroundColor Yellow
  9. python manage.py makemigrations
  10. python manage.py migrate
  11. # 启动Daphne服务器
  12. Write-Host "启动后端服务 (端口: 8008)..." -ForegroundColor Green
  13. Write-Host "服务地址: http://0.0.0.0:8008" -ForegroundColor Cyan
  14. daphne -b 0.0.0.0 -p 8008 greaterwms.asgi:application