mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-24 10:51:09 -05:00
Add secret management guide, client-side performance monitoring, and search accessibility enhancements
- Introduced a comprehensive Secret Management Guide detailing best practices, secret classification, development setup, production management, rotation procedures, and emergency protocols. - Implemented a client-side performance monitoring script to track various metrics including page load performance, paint metrics, layout shifts, and memory usage. - Enhanced search accessibility with keyboard navigation support for search results, ensuring compliance with WCAG standards and improving user experience.
This commit is contained in:
@@ -1,24 +1,74 @@
|
||||
"""
|
||||
Email configuration for thrillwiki project.
|
||||
|
||||
This module configures email backends and settings using python-decouple
|
||||
for consistent environment variable management across the project.
|
||||
|
||||
Why python-decouple?
|
||||
- Already used in base.py for consistency
|
||||
- Simpler API than django-environ
|
||||
- Sufficient for our configuration needs
|
||||
- Better separation of config from code
|
||||
"""
|
||||
|
||||
import environ
|
||||
from decouple import config
|
||||
|
||||
env = environ.Env()
|
||||
# =============================================================================
|
||||
# Email Backend Configuration
|
||||
# =============================================================================
|
||||
# Choose the appropriate email backend based on your environment:
|
||||
# - Console: django.core.mail.backends.console.EmailBackend (development)
|
||||
# - ForwardEmail: django_forwardemail.backends.ForwardEmailBackend (production)
|
||||
# - SMTP: django.core.mail.backends.smtp.EmailBackend (custom SMTP)
|
||||
|
||||
# Email settings
|
||||
EMAIL_BACKEND = env(
|
||||
"EMAIL_BACKEND", default="email_service.backends.ForwardEmailBackend"
|
||||
EMAIL_BACKEND = config(
|
||||
"EMAIL_BACKEND",
|
||||
default="django_forwardemail.backends.ForwardEmailBackend"
|
||||
)
|
||||
FORWARD_EMAIL_BASE_URL = env(
|
||||
"FORWARD_EMAIL_BASE_URL", default="https://api.forwardemail.net"
|
||||
|
||||
# =============================================================================
|
||||
# ForwardEmail Configuration
|
||||
# =============================================================================
|
||||
# ForwardEmail is a privacy-focused email service that supports custom domains
|
||||
# https://forwardemail.net/
|
||||
|
||||
FORWARD_EMAIL_BASE_URL = config(
|
||||
"FORWARD_EMAIL_BASE_URL",
|
||||
default="https://api.forwardemail.net"
|
||||
)
|
||||
SERVER_EMAIL = env("SERVER_EMAIL", default="django_webmaster@thrillwiki.com")
|
||||
FORWARD_EMAIL_API_KEY = config("FORWARD_EMAIL_API_KEY", default="")
|
||||
FORWARD_EMAIL_DOMAIN = config("FORWARD_EMAIL_DOMAIN", default="")
|
||||
|
||||
# Email URLs can be configured using EMAIL_URL environment variable
|
||||
# Example: EMAIL_URL=smtp://user:pass@localhost:587
|
||||
EMAIL_URL = env("EMAIL_URL", default=None)
|
||||
# Server email address for sending system emails
|
||||
SERVER_EMAIL = config("SERVER_EMAIL", default="django_webmaster@thrillwiki.com")
|
||||
|
||||
if EMAIL_URL:
|
||||
email_config = env.email(EMAIL_URL)
|
||||
vars().update(email_config)
|
||||
# =============================================================================
|
||||
# SMTP Configuration
|
||||
# =============================================================================
|
||||
# These settings are used when EMAIL_BACKEND is set to SMTP backend
|
||||
# Configure via individual environment variables or EMAIL_URL
|
||||
|
||||
EMAIL_HOST = config("EMAIL_HOST", default="localhost")
|
||||
EMAIL_PORT = config("EMAIL_PORT", default=587, cast=int)
|
||||
EMAIL_USE_TLS = config("EMAIL_USE_TLS", default=True, cast=bool)
|
||||
EMAIL_USE_SSL = config("EMAIL_USE_SSL", default=False, cast=bool)
|
||||
EMAIL_HOST_USER = config("EMAIL_HOST_USER", default="")
|
||||
EMAIL_HOST_PASSWORD = config("EMAIL_HOST_PASSWORD", default="")
|
||||
|
||||
# =============================================================================
|
||||
# Email Timeout and Retry Settings
|
||||
# =============================================================================
|
||||
# Timeout for email operations in seconds
|
||||
EMAIL_TIMEOUT = config("EMAIL_TIMEOUT", default=30, cast=int)
|
||||
|
||||
# Default from email address
|
||||
DEFAULT_FROM_EMAIL = config(
|
||||
"DEFAULT_FROM_EMAIL",
|
||||
default="ThrillWiki <noreply@thrillwiki.com>"
|
||||
)
|
||||
|
||||
# =============================================================================
|
||||
# Email Subject Prefix
|
||||
# =============================================================================
|
||||
# Prefix added to the subject of emails sent by Django admin
|
||||
EMAIL_SUBJECT_PREFIX = config("EMAIL_SUBJECT_PREFIX", default="[ThrillWiki] ")
|
||||
|
||||
Reference in New Issue
Block a user