This is a simple Flask application that fetches weather data from the OpenWeatherMap API based on user input (city name) and displays the weather information.
- Allows users to input a city name and retrieve weather information.
- Displays temperature, description, and weather icon for the specified city.
Before running this application, you need to obtain an API key from OpenWeatherMap. You can sign up and get your API key here.
-
Clone the repository:
git clone https://github.com/your_username/flask-weather-app.git
-
Navigate to the project directory:
cd flask-weather-app
-
Install dependencies:
pip install -r requirements.txt
-
Create a
.env
file in the root directory of the project and add your OpenWeatherMap API key:OPENWEATHERMAP_API_KEY=YOUR_OPENWEATHERMAP_API_KEY
-
Run the Flask application:
python app.py
-
Open your web browser and go to http://localhost:5000.
-
Enter a city name in the input field and click "Get Weather" to retrieve weather information for that city.
Contributions are welcome! If you'd like to contribute to this project, please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/my-feature
). - Make your changes.
- Commit your changes (
git commit -am 'Add my feature'
). - Push to the branch (
git push origin feature/my-feature
). - Create a new pull request.