This is a simple Flask web application that allows users to check the weather for a city in the USA. It uses the WeatherAPI to provide weather information based on user input.
- Users can enter the name of a city in the USA.
- The app validates whether the city is a valid city in the USA.
- If the city is valid, it retrieves and displays weather information.
- If the city is not valid, it displays an error message and clears the input field.
- The app uses a separate configuration file to store the WeatherAPI key for security.
Before running this application, you need to have the following installed:
- Python 3
- Flask
- Requests (for making API requests)
-
Clone the repository to your local machine:
git clone https://github.com/yourusername/weather-app.git
-
Navigate to the project directory:
cd weather-app
-
Create a virtual environment (optional but recommended):
python -m venv venv
-
Activate the virtual environment:
source venv/bin/activate
-
Install the required Python packages:
pip install -r requirements.txt
- Run the Flask app:
python app.py
- Open a web browser and navigate to http://localhost:8080/ to access the application.
- Enter the name of a city in the USA into the input field and click the "Get Weather" button.
- If the city is valid, you will see weather information displayed on the page.
- If the city is not valid, you will see an error message, and the input field will be cleared.
Contributions are welcome! If you would like to contribute to this project, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and test them.
- Commit your changes with descriptive commit messages.
- Push your changes to your fork.
- Submit a pull request to the main repository.
At this moment the app is running in Cloud Run, click here to try it!