mirror of
https://github.com/suitenumerique/docs.git
synced 2026-05-10 09:02:35 +02:00
We added the `FRONTEND_URL_JSON_FOOTER` environment variable. It will give the possibility to generate your own footer content in the frontend. If the variable is not set, the footer will not be displayed.
26 lines
584 B
Python
26 lines
584 B
Python
"""Config services."""
|
|
|
|
import logging
|
|
|
|
import requests
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
def get_footer_json(footer_json_url: str) -> dict:
|
|
"""
|
|
Fetches the footer JSON from the given URL."
|
|
"""
|
|
try:
|
|
response = requests.get(
|
|
footer_json_url, timeout=5, headers={"User-Agent": "Docs-Application"}
|
|
)
|
|
response.raise_for_status()
|
|
|
|
footer_json = response.json()
|
|
|
|
return footer_json
|
|
except (requests.RequestException, ValueError) as e:
|
|
logger.error("Failed to fetch footer JSON: %s", e)
|
|
return {}
|