Files
hertz_django/.env
2025-11-21 17:41:51 +08:00

50 lines
1.7 KiB
Bash
Raw 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.

# Django Configuration
SECRET_KEY=django-insecure-0a1bx*8!97l^4z#ml#ufn_*9ut*)zlso$*k-g^h&(2=p@^51md
DEBUG=True
#ALLOWED_HOSTS=localhost,127.0.0.1,django-host,192.168.1.22
ALLOWED_HOSTS=*
# Database Configuration
USE_REDIS_AS_DB=True
# MySQL Configuration (when USE_REDIS_AS_DB=False)
DB_NAME=hertz_server
DB_USER=root
DB_PASSWORD=root
DB_HOST=localhost
DB_PORT=3306
# Redis Configuration
REDIS_URL=redis://127.0.0.1:6379/0
# CORS Configuration
CORS_ALLOWED_ORIGINS=http://localhost:3000,http://127.0.0.1:3000
CORS_ALLOW_ALL_ORIGINS=True
# Email Configuration
EMAIL_BACKEND=django.core.mail.backends.smtp.EmailBackend
EMAIL_HOST=smtp.qq.com
EMAIL_PORT=465
EMAIL_USE_SSL=True
EMAIL_USE_TLS=False
EMAIL_HOST_USER=<redacted>
EMAIL_HOST_PASSWORD=<redacted>
DEFAULT_FROM_EMAIL=<redacted>
# 注册邮箱验证码开关0=关闭1=开启)
REGISTER_EMAIL_VERIFICATION=0
# Hertz Captcha Configuration
HERTZ_CAPTCHA_LENGTH=4
HERTZ_CAPTCHA_WIDTH=120
HERTZ_CAPTCHA_HEIGHT=50
HERTZ_CAPTCHA_FONT_SIZE=30
HERTZ_CAPTCHA_TIMEOUT=300
HERTZ_CAPTCHA_BACKGROUND_COLOR=#ffffff
HERTZ_CAPTCHA_FOREGROUND_COLOR=#000000
HERTZ_CAPTCHA_NOISE_LEVEL=0.3
HERTZ_CAPTCHA_REDIS_KEY_PREFIX=hertz_captcha:
# Auth Middleware Configuration - 不需要登录验证的URL模式支持正则表达式
# 格式:使用逗号分隔的正则表达式模式
# 示例:/api/demo 表示demo接口/api/.* 表示/api路径下的所有
NO_AUTH_PATTERNS=^/api/auth/login/?$,^/api/auth/register/?$,^/api/auth/email/code/?$,^/api/auth/send-email-code/?$,^/api/auth/password/reset/?$,^/api/captcha/.*$,^/api/docs/.*$,^/api/redoc/.*$,^/api/schema/.*$,^/admin/.*$,^/static/.*$,^/media/.*$,^/demo/.*$,^/websocket/.*$,^/api/system/.*$,^/yolo/.*$,