49 lines
972 B
Python
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,
|
|
}
|