35 lines
1.2 KiB
PowerShell
35 lines
1.2 KiB
PowerShell
# 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 |