diff options
Diffstat (limited to 'gn3')
-rw-r--r-- | gn3/llms/client.py | 4 | ||||
-rw-r--r-- | gn3/settings.py | 1 |
2 files changed, 2 insertions, 3 deletions
diff --git a/gn3/llms/client.py b/gn3/llms/client.py index f205247..6bcbf31 100644 --- a/gn3/llms/client.py +++ b/gn3/llms/client.py @@ -5,13 +5,13 @@ import os import datetime import time import requests +from flask import current_app from requests import Session from urllib.parse import urljoin from requests.packages.urllib3.util.retry import Retry from requests import HTTPError from requests import Session from requests.adapters import HTTPAdapter -from gn3.settings import FAHAMU_AUTH_TOKEN basedir = os.path.join(os.path.dirname(__file__)) @@ -59,7 +59,7 @@ class GeneNetworkQAClient(Session): def __init__(self, account, api_key, version="v3", timeout=5, total_retries=5, backoff_factor=30): super().__init__() - self.headers.update({"Authorization": "Bearer " + FAHAMU_AUTH_TOKEN}) + self.headers.update({"Authorization": "Bearer " + current_app.config.get("FAHAMU_AUTH_TOKEN","")}) self.answer_url = f"{self.BASE_URL}/answers" self.feedback_url = f"{self.BASE_URL}/feedback" diff --git a/gn3/settings.py b/gn3/settings.py index a929e11..ca4d271 100644 --- a/gn3/settings.py +++ b/gn3/settings.py @@ -34,7 +34,6 @@ SECRET_KEY = "password" # gn2 results only used in fetching dataset info # FAHAMU API TOKEN -FAHAMU_AUTH_TOKEN = os.environ.get("FAHAMU_AUTH_TOKEN","") GN2_BASE_URL = "http://www.genenetwork.org/" |