Skip to content

Latest commit

 

History

History
34 lines (25 loc) · 630 Bytes

File metadata and controls

34 lines (25 loc) · 630 Bytes

Python Weather App

Flask app that shows current weather for a city, using the OpenWeatherMap API.

Run it

  1. Clone the repo, cd into it

  2. Set up a virtual environment and install packages:

python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
  1. Get a free API key from https://openweathermap.org/ (Account > API keys)

  2. Create a .env file in the project folder with:

API_KEY=your_key_here
  1. Run it:
python server.py

Open http://localhost:8000

Files

  • server.py - Flask routes
  • weather.py - calls the weather API
  • templates/ - HTML pages
  • static/ - CSS