Show a fallback when Swagger UI and ReDoc cannot load

Both pages pull their JavaScript from cdn.jsdelivr.net, which is unreachable
behind an authenticating proxy — the page looked blank with no explanation.

- override drf_spectacular/swagger_ui.html and redoc.html in project
  templates
- if the library is missing or nothing rendered after 4 seconds, show a
  short message with a link to /api/docs/ (the offline reference)
- drop the Google Fonts request from the ReDoc page (also blocked)
- note the behaviour in docs/client-links.md
This commit is contained in:
apuc committed 2026-11-22 23:37:17 +03:00
1 parent 666e2d5685
commit 50468e2384
3 files changed
+145

No files matched your search

+4
View File
@@ -56,6 +56,10 @@ cd /home/apuc/homm/backend && ../.venv/bin/python manage.py createsuperuser
| https://homm.my-dpr.ru/api/schema/ | Схема OpenAPI в YAML — для генерации клиента |
| https://homm.my-dpr.ru/api/v1/health/ | Проверка живости сайта и базы |
`/api/swagger/` и `/api/redoc/` подгружают библиотеки с CDN. В сети без доступа
к `cdn.jsdelivr.net` они показывают заглушку со ссылкой на `/api/docs/` —
рабочий вариант без интернета.
## Для 1С-программиста
Базовый адрес: `https://homm.my-dpr.ru/api/v1/integration/1c/`