37733-vm/core/context_processors.py
Flatlogic Bot 9964306747 change27
2026-01-23 17:14:56 +00:00

16 lines
532 B
Python

import os
import time
from .models import AppSetting
def project_context(request):
"""
Adds project-specific environment variables and app settings to the template context globally.
"""
app_settings = AppSetting.objects.first()
return {
"project_description": os.getenv("PROJECT_DESCRIPTION", ""),
"project_image_url": os.getenv("PROJECT_IMAGE_URL", ""),
# Used for cache-busting static assets
"deployment_timestamp": int(time.time()),
"app_settings": app_settings,
}