2026-07-06 17:46:15 +08:00
|
|
|
|
# Skelet 环境变量示例
|
2026-07-06 18:04:10 +08:00
|
|
|
|
#
|
|
|
|
|
|
# 本文件不直接加载到 Django settings;部署时需将这些变量注入 shell 环境。
|
|
|
|
|
|
# 注入方式取决于运行环境:
|
|
|
|
|
|
# - 本地开发(MSYS2 bash): export $(cat .env | xargs) 或手动 export
|
|
|
|
|
|
# - systemd (Gunicorn): EnvironmentFile=/path/to/.env
|
|
|
|
|
|
# - 托管平台 (VPS hosting): 通过面板或 SSH config 设置环境变量
|
|
|
|
|
|
# - Docker: docker run --env-file .env
|
|
|
|
|
|
#
|
|
|
|
|
|
# 真实 .env 文件已被 .gitignore 忽略,不会提交。
|
2026-07-06 17:46:15 +08:00
|
|
|
|
|
|
|
|
|
|
# Django 密钥(生产环境必须替换为随机字符串)
|
|
|
|
|
|
# 生成方式: python -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())"
|
|
|
|
|
|
SECRET_KEY=replace-me
|
|
|
|
|
|
|
|
|
|
|
|
# 调试模式(开发 True,生产 False)
|
|
|
|
|
|
DEBUG=True
|
|
|
|
|
|
|
|
|
|
|
|
# 允许访问的主机名,逗号分隔
|
|
|
|
|
|
# 开发: localhost,127.0.0.1
|
|
|
|
|
|
# 生产: yourdomain.com,www.yourdomain.com
|
|
|
|
|
|
ALLOWED_HOSTS=localhost,127.0.0.1
|
|
|
|
|
|
|
|
|
|
|
|
# Wagtail 管理后台基础 URL(用于邮件通知等)
|
|
|
|
|
|
# 开发: http://localhost:8000
|
|
|
|
|
|
# 生产: https://yourdomain.com
|
|
|
|
|
|
WAGTAILADMIN_BASE_URL=http://localhost:8000
|