Files
SMANAGE/ATestCServer/start.ps1
T
2026-06-16 11:55:14 +08:00

35 lines
1.2 KiB
PowerShell
Raw 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.
# ATestCServer 启动脚本
# HTTP 端口 25080,HTTPS 端口 25443
#
# 用法:
# .\start.ps1 # 普通启动
# .\start.ps1 -Migrate # 带数据库迁移
param(
[switch]$Migrate = $false
)
$ErrorActionPreference = "Stop"
$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
Set-Location $ScriptDir
Write-Host "============================" -ForegroundColor Cyan
Write-Host " ATestCServer 子服务器启动" -ForegroundColor Cyan
Write-Host " HTTP : http://127.0.0.1:25080" -ForegroundColor Green
Write-Host " HTTPS : https://127.0.0.1:25443" -ForegroundColor Green
Write-Host " MSYNC → https://www.gvsds.com" -ForegroundColor Yellow
Write-Host " (父) → http://127.0.0.1:25080 (本地回环)" -ForegroundColor Yellow
Write-Host "============================" -ForegroundColor Cyan
$env:PYTHONPATH = "$ScriptDir;$ScriptDir\..\gvsdsdk"
if ($Migrate) {
Write-Host "[*] 执行数据库迁移..." -ForegroundColor Magenta
python manage.py makemigrations sub_server
python manage.py migrate
Write-Host "[√] 迁移完成" -ForegroundColor Green
}
Write-Host "[*] 启动 Django 开发服务器..." -ForegroundColor Magenta
python manage.py runserver 0.0.0.0:25080