Files
blog/config/local_settings.example.py
2026-08-25 19:02:52 +08:00

38 lines
1.0 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""
生产环境本地设置
使用方法:复制为 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',
# }
# }