From df34e5a0f8d27e495394c92dcbc5b088003ab3b9 Mon Sep 17 00:00:00 2001 From: Anant Jain Date: Mon, 12 Oct 2026 20:27:26 +0530 Subject: [PATCH] fix(api): point PUBLIC_API_URL fallback at the live prod API The fallback https://api.civicdataspace.in does not resolve, so every download_url in DCAT/Croissant/Dublin Core exports was a dead link when PUBLIC_API_URL was unset. Use https://api.datakeep.civicdays.in, the prod API host, in settings, the export adapter and .env.example. Closes #238 --- .env.example | 2 +- DataSpace/settings.py | 2 +- api/services/metadata_export/adapter.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.env.example b/.env.example index 7887793e..136af89e 100644 --- a/.env.example +++ b/.env.example @@ -21,7 +21,7 @@ GITHUB_TOKEN= # URLs written into exported metadata (DCAT / Croissant); set per environment PUBLIC_SITE_URL=https://civicdataspace.in -PUBLIC_API_URL=https://api.civicdataspace.in +PUBLIC_API_URL=https://api.datakeep.civicdays.in # --- s3 only --- # STORAGE_BUCKET=dataspace-dev diff --git a/DataSpace/settings.py b/DataSpace/settings.py index f3e4c0ab..d390827e 100644 --- a/DataSpace/settings.py +++ b/DataSpace/settings.py @@ -306,7 +306,7 @@ # Absolute URLs written into exported metadata documents (dataset landing page, # download links). Override on any environment that is not production. PUBLIC_SITE_URL = os.getenv("PUBLIC_SITE_URL", "https://civicdataspace.in") -PUBLIC_API_URL = os.getenv("PUBLIC_API_URL", "https://api.civicdataspace.in") +PUBLIC_API_URL = os.getenv("PUBLIC_API_URL", "https://api.datakeep.civicdays.in") # DVC settings DVC_REPO_PATH = os.path.join(BASE_DIR, "dvc") diff --git a/api/services/metadata_export/adapter.py b/api/services/metadata_export/adapter.py index 2899c71b..9c8cfcda 100644 --- a/api/services/metadata_export/adapter.py +++ b/api/services/metadata_export/adapter.py @@ -25,7 +25,7 @@ def _public_base() -> str: def _api_base() -> str: - return getattr(settings, "PUBLIC_API_URL", "https://api.civicdataspace.in").rstrip("/") + return getattr(settings, "PUBLIC_API_URL", "https://api.datakeep.civicdays.in").rstrip("/") def _iso(dt: Any) -> Optional[str]: