Files
DjangoAdmin DevandClaude 15f2a5e097 chore: 基线提交(重构前代码快照)
- git 初始化 + .gitignore 补全(根 .env / logs / instance / __pycache__ 等)
- 修复 utils/.gitignore 误将整个 utils/ 源码层忽略的问题,补入全部工具源码(含 ip2region.xdb)
- 含后端全部代码:application / extensions / utils / config / migrations
- 含前端 ui/(后续整体迁走)
- 不含根 .env(含密钥,本地保留)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-07 12:12:06 +08:00

42 lines
1.3 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.
"""
邮件配置模块
=============================================================
包含 SMTP 邮件发送相关的所有配置项。
依赖:config/__init__.py 中的 _load_env_file() 已提前加载 .env
"""
import os
# ============================================================
# 邮件配置
# ============================================================
# 邮件发送方式(smtp / sendmail)
MAIL_MAILER = os.getenv('MAIL_MAILER', 'smtp')
# 邮件服务器地址(163邮箱:smtp.163.com,QQ邮箱:smtp.qq.com)
MAIL_SERVER = os.getenv('MAIL_SERVER', 'smtp.163.com')
# 邮件服务器端口(465-SSL加密,587-TLS加密)
MAIL_PORT = int(os.getenv('MAIL_PORT', 465))
# 是否启用SSL加密:True-启用,False-不启用
MAIL_USE_SSL = os.getenv('MAIL_USE_SSL', 'True') == 'True'
# 授权邮箱用户名(发送邮件的邮箱地址)
MAIL_USERNAME = os.getenv('MAIL_USERNAME', '')
# 授权邮箱授权码(不是登录密码,需在邮箱设置中获取)
MAIL_PASSWORD = os.getenv('MAIL_PASSWORD', '')
# 邮件加密方式(ssl / tls)
MAIL_ENCRYPTION = os.getenv('MAIL_ENCRYPTION', '')
# 邮件发件人名称(显示在收件人处)
MAIL_FROM_NAME = os.getenv('MAIL_FROM_NAME', '')
# 邮件发件人地址(与MAIL_USERNAME保持一致)
MAIL_FROM_ADDRESS = os.getenv('MAIL_FROM_ADDRESS', '')