Fix grammar

This commit is contained in:
Baohua Yang
2026-02-17 22:17:02 -08:00
parent f68795f34c
commit 063c3f1381
62 changed files with 117 additions and 161 deletions

View File

@@ -291,9 +291,7 @@ $ docker compose exec db psql -U django_user -d django_db
#### Q1: 数据库连接失败
**错误信息**`django.db.utils.OperationalError: could not connect to server`
**可能原因与解决方案**
**错误信息**`django.db.utils.OperationalError: could not connect to server`**可能原因与解决方案**
| 原因 | 解决方案 |
|------|---------|
@@ -336,9 +334,7 @@ $ sudo chown -R $USER:$USER .
| **DEBUG** | `True` | `False` |
| **密码管理** | 明文写在配置 | 使用 Docker Secrets 或环境变量 |
| **Volume** | 挂载代码目录 | 代码直接 COPY 进镜像 |
| **ALLOWED_HOSTS** | `['*']` | 具体域名 |
**生产环境 Compose 文件示例**
| **ALLOWED_HOSTS**| `['*']` | 具体域名 |**生产环境 Compose 文件示例**
```yaml
## compose.prod.yaml
@@ -348,10 +344,12 @@ services:
build: .
command: gunicorn mysite.wsgi:application --bind 0.0.0.0:8000
# 不挂载代码,使用镜像内的代码
environment:
DEBUG: 'False'
ALLOWED_HOSTS: 'example.com,www.example.com'
# ...
```
### 延伸阅读