ddavydov commited on
Commit
542834b
·
verified ·
1 Parent(s): 28abda2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -14,7 +14,10 @@ def get_weather(city: str) -> str:
14
  city: Name of the city (e.g., 'Paris').
15
  """
16
  try:
17
- api_key = "your_openweathermap_api_key"
 
 
 
18
  response = requests.get(
19
  f"http://api.openweathermap.org/data/2.5/weather?q={city}&appid={api_key}&units=metric"
20
  )
 
14
  city: Name of the city (e.g., 'Paris').
15
  """
16
  try:
17
+ api_key = os.getenv("OPENWEATHERMAP_API_KEY")
18
+ if not api_key:
19
+ return "OPENWEATHERMAP_API_KEY key not found"
20
+
21
  response = requests.get(
22
  f"http://api.openweathermap.org/data/2.5/weather?q={city}&appid={api_key}&units=metric"
23
  )