38 lines
1.0 KiB
Python
38 lines
1.0 KiB
Python
"""
|
||
生产环境本地设置
|
||
使用方法:复制为 local_settings.py 并按需修改
|
||
cp local_settings.example.py local_settings.py
|
||
|
||
此文件已在 .gitignore 中忽略,不会提交到仓库。
|
||
在此文件中覆盖 settings.py 中的任意配置。
|
||
"""
|
||
|
||
# ============ 安全配置 ============
|
||
# 生成方式: python -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())"
|
||
SECRET_KEY = 'your-production-secret-key-here'
|
||
|
||
DEBUG = False
|
||
|
||
ALLOWED_HOSTS = ['www.yuangyaa.com', 'yuangyaa.com']
|
||
|
||
# ============ 数据库配置 ============
|
||
# SQLite(轻量级,适合小规模站点)
|
||
# DATABASES = {
|
||
# 'default': {
|
||
# 'ENGINE': 'django.db.backends.sqlite3',
|
||
# 'NAME': BASE_DIR / 'db.sqlite3',
|
||
# }
|
||
# }
|
||
|
||
# PostgreSQL(推荐生产环境)
|
||
# DATABASES = {
|
||
# 'default': {
|
||
# 'ENGINE': 'django.db.backends.postgresql',
|
||
# 'NAME': 'blog',
|
||
# 'USER': 'blog_user',
|
||
# 'PASSWORD': 'your_password',
|
||
# 'HOST': 'localhost',
|
||
# 'PORT': '5432',
|
||
# }
|
||
# }
|