Dingyi6 commited on
Commit
bf73095
·
1 Parent(s): b5131e3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -151,6 +151,8 @@ app_ui = ui.page_fluid(
151
  )
152
  )
153
 
 
 
154
  # re-run when a user using the application
155
  def server(input, output, session):
156
  global weather_data, remap_flag, address_line, weather_fig, m
@@ -171,7 +173,7 @@ def server(input, output, session):
171
 
172
  # # Check if it's on time locally
173
  # if(weather_data == None or (current_time.minute == 0 and current_time.second == 0)):
174
- weather_url = f"https://api.tomorrow.io/v4/weather/forecast?location={lat},{lon}&apikey={os.environ.get("WEATHER_TOKEN")}"
175
  response = requests.get(weather_url)
176
  if response.status_code != 200:
177
  raise Exception(f"Error fetching {weather_url}: {response.status_code}")
 
151
  )
152
  )
153
 
154
+ weather_token = os.environ.get("WEATHER_TOKEN")
155
+
156
  # re-run when a user using the application
157
  def server(input, output, session):
158
  global weather_data, remap_flag, address_line, weather_fig, m
 
173
 
174
  # # Check if it's on time locally
175
  # if(weather_data == None or (current_time.minute == 0 and current_time.second == 0)):
176
+ weather_url = f"https://api.tomorrow.io/v4/weather/forecast?location={lat},{lon}&apikey={weather_token}"
177
  response = requests.get(weather_url)
178
  if response.status_code != 200:
179
  raise Exception(f"Error fetching {weather_url}: {response.status_code}")