gabcares commited on
Commit
315b0b3
·
verified ·
1 Parent(s): b8ad17a

Update utils/config.py

Browse files

Get environment using os.getenv()

Files changed (1) hide show
  1. utils/config.py +4 -3
utils/config.py CHANGED
@@ -1,3 +1,4 @@
 
1
  from dotenv import dotenv_values
2
  from pathlib import Path
3
  from ipyleaflet import basemaps
@@ -7,7 +8,7 @@ from shiny.express import ui
7
 
8
  # Paths
9
  # ENV when using standalone shiny server, shiny for python runs from the root of the project
10
- ENV_PATH = Path("env/online.env")
11
 
12
  DATA = Path(__file__).parent.parent / "data/"
13
  TEST_FILE = DATA / "Test.csv"
@@ -38,12 +39,12 @@ WEATHER_FILE_URL = "https://raw.githubusercontent.com/valiantezabuku/Yassir-ETA-
38
 
39
 
40
  # Load environment variables from .env file into a dictionary
41
- environment_variables = dotenv_values(ENV_PATH)
42
 
43
 
44
  # Get the OpenRouteService API key
45
  # https://openrouteservice.org/dev/#/home
46
- ors_api_key = environment_variables.get("ORS_API_TOKEN")
47
 
48
  # https://maps.app.goo.gl/Fx5rdPs1KeA6jCeB8
49
  KENYA_LAT = 0.15456
 
1
+ import os
2
  from dotenv import dotenv_values
3
  from pathlib import Path
4
  from ipyleaflet import basemaps
 
8
 
9
  # Paths
10
  # ENV when using standalone shiny server, shiny for python runs from the root of the project
11
+ # ENV_PATH = Path("env/online.env")
12
 
13
  DATA = Path(__file__).parent.parent / "data/"
14
  TEST_FILE = DATA / "Test.csv"
 
39
 
40
 
41
  # Load environment variables from .env file into a dictionary
42
+ # environment_variables = dotenv_values(ENV_PATH)
43
 
44
 
45
  # Get the OpenRouteService API key
46
  # https://openrouteservice.org/dev/#/home
47
+ ors_api_key = os.getenv("ORS_API_TOKEN")
48
 
49
  # https://maps.app.goo.gl/Fx5rdPs1KeA6jCeB8
50
  KENYA_LAT = 0.15456