A Django-based Weather Application that fetches real-time weather data using an external Weather API.
This project demonstrates how to integrate third-party APIs in Django, process JSON responses, and display dynamic weather information using web templates.
- Python
- Django
- Weather API (API Integration)
- HTML & CSS
- SQLite
- Django Project & App Structure
- API Integration in Django
- Handling JSON Responses
- Function-Based Views (FBV)
- Dynamic Data Rendering with Templates
weather-app/
│
├── core/
│ ├── settings.py
│ ├── urls.py
│ ├── asgi.py
│ └── wsgi.
│
├── weather/
│ ├── migrations
│ ├── templates/
│ ├── static/
│ ├── views.py
│ ├── urls.py
│ ├── models.py
│ └── apps.py
│ ├── web/
│ ├── templates
│ └── static/
│
├── db.sqlite3
├── manage.py
└── README.md
Main Django project configuration.
- Handles settings, middleware, and root URLs.
Main app responsible for:
- API integration
- Fetching weather data
- Processing JSON responses
- Sending data to templates
Contains frontend templates and static files for UI rendering.
SQLite database used for storing application data (if required).
Command-line utility to manage Django project operations.
- User enters a city name
- Django view sends a request to the Weather API
- API returns weather data in JSON format
- JSON data is processed in the backend
- Weather details are displayed on the web page
- Install required packages:
pip install django requests
2. Run the server:
python manage.py runserver
3. Open browser:
http://127.0.0.1:8000/