hotpocket/services/backend/hotpocket_backend/apps/ui/context_processors.py
Tomek Wójcik b4338e2769
Some checks failed
CI / Checks (push) Failing after 13m2s
Release v1.0.0
2025-08-20 21:00:50 +02:00

49 lines
972 B
Python

# -*- coding: utf-8 -*-
from __future__ import annotations
from django.http import HttpRequest
from hotpocket_backend._meta import version as backend_version
from hotpocket_backend.apps.core.conf import settings
from hotpocket_backend.apps.core.context import get_request_id
def site_title(request: HttpRequest) -> dict:
return {
'SITE_TITLE': settings.SITE_TITLE,
}
def image_tag(request: HttpRequest) -> dict:
return {
'IMAGE_ID': settings.IMAGE_ID,
}
def request_id(request: HttpRequest) -> dict:
return {
'REQUEST_ID': get_request_id(),
}
def htmx(request: HttpRequest) -> dict:
return {
'HTMX': (
request.htmx
if hasattr(request, 'htmx')
else False
),
}
def debug(request: HttpRequest) -> dict:
return {
'DEBUG': settings.DEBUG,
}
def version(request: HttpRequest) -> dict:
return {
'VERSION': backend_version,
}