Spaces:
Runtime error
Runtime error
Download apps/rag/api_client.py from junaidte14/django-admin-dashboard: direct link, hf CLI and curl.
- Browser
- Download file 382 Bytes
-
https://huggingface.co/spaces/junaidte14/django-admin-dashboard/resolve/main/apps/rag/api_client.py
- Command line
-
hf download hf://spaces/junaidte14/django-admin-dashboard/apps/rag/api_client.py
-
curl -L -o api_client.py https://huggingface.co/spaces/junaidte14/django-admin-dashboard/resolve/main/apps/rag/api_client.py
382 Bytes
| # apps/rag/services/api_client.py | |
| import httpx | |
| from django.conf import settings | |
| def fastapi_client(request): | |
| token = request.COOKIES.get("access_token") | |
| return httpx.Client( | |
| base_url=settings.FASTAPI_BASE_URL, | |
| headers={ | |
| "Authorization": f"Bearer {token}", | |
| "Content-Type": "application/json", | |
| }, | |
| timeout=300.0, | |
| ) |