38156-vm/core/context_processors.py
Konrad du Plessis 0169f09131 Add database indexes and minor performance fixes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 00:25:43 +02:00

19 lines
510 B
Python

import os
import time
# Computed once at module load — changes per server restart/deploy
_DEPLOYMENT_TIMESTAMP = int(time.time())
# === TEMPLATE CONTEXT PROCESSORS ===
def project_context(request):
"""
Adds project-specific environment variables to the template context globally.
"""
return {
"project_description": os.getenv("PROJECT_DESCRIPTION", ""),
"project_image_url": os.getenv("PROJECT_IMAGE_URL", ""),
"deployment_timestamp": _DEPLOYMENT_TIMESTAMP,
}