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:
pacnpal
2025-12-23 16:41:42 -05:00
parent ae31e889d7
commit edcd8f2076
155 changed files with 22046 additions and 4645 deletions

View File

@@ -3,7 +3,6 @@
import os
import sys
from decouple import config
def main():
@@ -32,7 +31,20 @@ def main():
def detect_settings_module():
"""Auto-detect the appropriate settings module based on context."""
"""
Auto-detect the appropriate settings module based on context.
Detection order:
1. DJANGO_SETTINGS_MODULE environment variable (explicit override)
2. Test command detection (uses test settings)
3. Production indicators (environment variables from cloud providers)
4. Staging indicators (staging-specific environment variables)
5. DEBUG environment variable (False = production)
6. Default to local development
Returns:
str: The settings module path (e.g., "config.django.local")
"""
# Check if DJANGO_SETTINGS_MODULE is already set
if "DJANGO_SETTINGS_MODULE" in os.environ:
return os.environ["DJANGO_SETTINGS_MODULE"]
@@ -43,20 +55,29 @@ def detect_settings_module():
return "config.django.test_accounts"
return "config.django.test"
# Check for production indicators
# Production indicators from various cloud providers
production_indicators = [
"DYNO", # Heroku
"AWS_EXECUTION_ENV", # AWS Lambda
"AWS_ECS_CLUSTER", # AWS ECS
"KUBERNETES_SERVICE_HOST", # Kubernetes
"DOCKER_CONTAINER", # Docker
"FLY_APP_NAME", # Fly.io
"RAILWAY_ENVIRONMENT", # Railway
"RENDER", # Render
"VERCEL", # Vercel
]
if any(indicator in os.environ for indicator in production_indicators):
return "config.django.production"
# Staging detection (explicit staging environment variable)
if os.environ.get("ENVIRONMENT", "").lower() in ("staging", "stage"):
return "config.django.production" # Use production settings for staging
# Check DEBUG environment variable
debug = os.environ.get("DEBUG", "").lower()
if debug in ("false", "0", "no"):
if debug in ("false", "0", "no", "off"):
return "config.django.production"
# Default to local development