Skip to content

Commit 534b08b

Browse files
Merge pull request #2546 from IFRCGo/feature/reliefweb-with-env-var
Use env var in reliefweb cronjob
2 parents c5d3203 + d87639b commit 534b08b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

databank/management/commands/sources/RELIEFWEB.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
import logging
44

55
import requests
6+
from django.conf import settings
67

78
from databank.models import Month, PastCrisesEvent, PastEpidemic
89

910
from .utils import catch_error, get_country_by_iso3
1011

1112
logger = logging.getLogger(__name__)
1213

13-
DISASTER_API = "https://api.reliefweb.int/v1/disasters/?appname=IFRCReport" # Change it to an env var
14+
DISASTER_API = f"https://api.reliefweb.int/v1/disasters/?appname={settings.RELIEF_WEB_APP_NAME}"
1415
RELIEFWEB_DATETIME_FORMAT = "%Y-%m-%d"
1516

1617

main/settings.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,9 @@ def decode_base64(env_key, fallback_env_key):
867867
if GO_ENVIRONMENT == "development":
868868
OAUTH2_PROVIDER["ALLOWED_REDIRECT_URI_SCHEMES"].append("http")
869869

870+
# ReliefWeb (for databank cronjob)
871+
RELIEF_WEB_APP_NAME = env("RELIEF_WEB_APP_NAME")
872+
870873
# Manual checks
871874
import main.checks # noqa: F401 E402
872875

0 commit comments

Comments
 (0)