Flask app that shows current weather for a city, using the OpenWeatherMap API.
-
Clone the repo, cd into it
-
Set up a virtual environment and install packages:
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
-
Get a free API key from https://openweathermap.org/ (Account > API keys)
-
Create a
.envfile in the project folder with:
API_KEY=your_key_here
- Run it:
python server.py
server.py- Flask routesweather.py- calls the weather APItemplates/- HTML pagesstatic/- CSS