This repository contains a simple web application built using Flask that allows users to check the current weather and forecast for a given city. The application uses the OpenWeatherMap API to retrieve weather data.
app.py
: The main Python file containing the Flask application.index.html
: The HTML template for the web interface.static/
: Directory containing static files such as images and CSS.Dockerfile
: Docker configuration file for containerizing the application.requirements.txt
: File specifying the Python dependencies for the project.
- Make sure you have Python installed on your machine.
- Install the required dependencies by running
pip install -r requirements.txt
. - Create an OpenWeatherMap API key and save it in a file named
api_key.py
in the same directory asapp.py
. - Run the application using the command
python app.py
. - Open a web browser and navigate to http://localhost:5000.
- Make sure you have Docker installed on your machine.
- Build the Docker image using the command
docker build -t weather-app .
. - Run the Docker container using the command
docker run -p 5000:5000 weather-app
. - Open a web browser and navigate to http://localhost:5000.
- Enter the name of a city in the provided input field.
- Click the "Get Weather" button to retrieve and display weather information.
- The application will show the current temperature, weather condition, humidity, and "feels like" temperature.
- Additionally, it displays a forecast for the current day, including temperature, weather condition, and "feels like" temperature at various times.
- If the entered city is not found, an error message "No City Found" will be displayed.
- The application was designed and developed by Achint Tyagi.