A Django-based Weather App that fetches and displays real-time weather data for any city using the OpenWeatherMap API. Stay updated with temperature, humidity, wind speed, and general weather conditions—all in a simple, sleek interface! 🌍
- 🔍 Search for weather by city name
- 🌡️ View temperature, humidity, wind speed, and weather condition
- 📱 Responsive, user-friendly interface
⚠️ Error handling for invalid city names or network issues- 🚀 Optional API response caching for better performance
Get the app up and running on your local machine in a few simple steps:
- 🐍 Python 3.8+
- 🌐 Django 4.0+
- 🔑 API Keys:
- Clone the Repository:
git clone https://github.com/SimranShaikh20/WeatherApplication cd Weather-App
- Go to the OpenWeatherMap API website.
- Sign up for a free account if you don’t already have one.
- After logging in, navigate to the API Keys section of your profile.
- Generate a new API key or use the default one provided.
- Copy the API key and add it to the
.env
file as:WEATHER_API_KEY=your_api_key_here
🔐 Getting API Keys 🌦️ Weather API (OpenWeatherMap)
- Go to the Google Custom Search API website.
- Sign in with your Google account.
- Navigate to the Get Started section and enable the Custom Search JSON API.
- Create a new search engine and configure it as per your requirements.
- Copy the API key provided in the Credentials section.
- Add the API key to your
.env
file as:SEARCH_ENGINE_API_KEY=your_search_engine_api_key_here
- Enter the city name in the search bar.
- Press the "Search" button.
- View the weather details for the entered city.
Weather-App/
├── weather_app/ # Main Django app containing settings and URLs
├── templates/ # HTML templates for the app
├── static/ # CSS, JavaScript, and image files
├── .env # Environment variables file
├── manage.py # Django management script
├── requirements.txt # Python dependencies
└── README.md # Project documentation
🔎 Google Custom Search API
The app uses the OpenWeatherMap API to fetch weather data. Make sure to generate an API key and add it to your .env
file as described in the installation steps.
GET https://api.openweathermap.org/data/2.5/weather?q=city_name&appid=your_api_key
- Fork the repository.
- Create a feature branch:
git checkout -b feature-name
- Commit your changes:
git commit -m "Add your message here"
- Push to the branch:
git push origin feature-name
- Create a Pull Request.