import os import time # Calculate once when the module is loaded (e.g. at server start) DEPLOYMENT_TIMESTAMP = int(time.time()) 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", ""), # Used for cache-busting static assets - stable until server restart "deployment_timestamp": DEPLOYMENT_TIMESTAMP, }