v0.3.2: minor push
CI / test (push) Canceled after 4s

This commit is contained in:
2026-08-08 22:19:23 +08:00
parent af3bee2609
commit 1f8822042f
5 changed files with 36 additions and 7 deletions
+15
View File
@@ -252,6 +252,7 @@ nano .env.production
DJANGO_SETTINGS_MODULE=config.settings
DJANGO_SECRET_KEY='替换为 openssl 生成的密钥'
DJANGO_DEBUG=false
DJANGO_USE_HTTPS=true
DJANGO_ALLOWED_HOSTS=math.example.com
DATABASE_URL='mysql://hulumath:ReplaceWithStrongPassword@127.0.0.1:3307/hulumath'
@@ -278,6 +279,20 @@ chown root:root .env.production
chmod 600 .env.production
```
仅使用 IP、尚未配置域名和证书时,可临时改为:
```dotenv
DJANGO_USE_HTTPS=false
DJANGO_ALLOWED_HOSTS=117.72.28.96,127.0.0.1,localhost
CORS_ALLOWED_ORIGINS=http://117.72.28.96
CSRF_TRUSTED_ORIGINS=http://117.72.28.96
SECURE_HSTS_SECONDS=0
DEPLOY_HEALTH_HOST=117.72.28.96
```
绑定域名并申请 SSL 后,必须把 `DJANGO_USE_HTTPS` 改回 `true`,并将
Allowed Hosts、CORS、CSRF 和健康检查 Host 全部替换为正式域名。
## 9. 在宝塔创建网站
宝塔 `网站``添加站点`