Referral Rewards V1

This commit is contained in:
Flatlogic Bot 2026-02-28 22:02:58 +00:00
parent 3c67ef4f81
commit ce20f7b1f5
16 changed files with 11 additions and 4 deletions

View File

@ -156,10 +156,6 @@ STATICFILES_DIRS = [
]
# Email
EMAIL_BACKEND = os.getenv(
"EMAIL_BACKEND",
"django.core.mail.backends.smtp.EmailBackend"
)
EMAIL_HOST = os.getenv("EMAIL_HOST", "127.0.0.1")
EMAIL_PORT = int(os.getenv("EMAIL_PORT", "587"))
EMAIL_HOST_USER = os.getenv("EMAIL_HOST_USER", "")
@ -173,6 +169,15 @@ CONTACT_EMAIL_TO = [
if item.strip()
]
# Default to console backend if SMTP settings are missing and in DEBUG mode
if DEBUG and not EMAIL_HOST_USER:
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
else:
EMAIL_BACKEND = os.getenv(
"EMAIL_BACKEND",
"django.core.mail.backends.smtp.EmailBackend"
)
# When both TLS and SSL flags are enabled, prefer SSL explicitly
if EMAIL_USE_SSL:
EMAIL_USE_TLS = False
@ -180,3 +185,5 @@ if EMAIL_USE_SSL:
# https://docs.djangoproject.com/en/5.2/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
LOGIN_REDIRECT_URL = 'dashboard'
LOGOUT_REDIRECT_URL = 'home'