初始化提交,包含完整的邮件系统代码
This commit is contained in:
25
local_settings.py
Normal file
25
local_settings.py
Normal file
@@ -0,0 +1,25 @@
|
||||
"""
|
||||
Windows环境下的本地设置
|
||||
这个文件包含仅适用于本地Windows开发环境的设置
|
||||
不会影响生产环境部署
|
||||
"""
|
||||
import platform
|
||||
import logging
|
||||
|
||||
# 是否启用Windows特殊设置
|
||||
IS_WINDOWS = platform.system().lower() == 'windows'
|
||||
|
||||
# Windows环境特定配置
|
||||
if IS_WINDOWS:
|
||||
# SMTP服务器配置
|
||||
SMTP_HOST = '127.0.0.1' # 在Windows上使用localhost而不是0.0.0.0
|
||||
SMTP_PORT = 3825 # 使用高端口避免权限问题
|
||||
|
||||
# 日志配置
|
||||
LOG_LEVEL = 'DEBUG'
|
||||
|
||||
# 调试信息
|
||||
logging.info(f"已加载Windows环境特殊配置: SMTP端口={SMTP_PORT}")
|
||||
else:
|
||||
# 非Windows环境下不做特殊处理
|
||||
pass
|
||||
Reference in New Issue
Block a user