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,
    }
