This project is a RESTful API built with Django that provides weather forecasts for different cities. It leverages the OpenWeatherMap API to fetch real-time weather data.
- Fetch weather data by city name.
- Simple user interface to display weather data using Svelte.
- Easy to extend and modify.
-
Clone the repository:
git clone https://github.com/yourusername/weather-forecast-api.git cd weather-forecast-api -
Set up the Django backend:
- Navigate to the backend folder:
cd backend - Install dependencies:
pip install -r requirements.txt
- Run migrations:
python manage.py migrate
- Start the Django server:
python manage.py runserver
- Navigate to the backend folder:
-
Set up the Svelte frontend:
- Open another terminal and navigate to the frontend folder:
cd frontend - Install dependencies:
npm install
- Start the Svelte development server:
npm run dev
- Open another terminal and navigate to the frontend folder:
- Access the API at
http://localhost:8000/weather/{city}to get weather data for the specified city. - Use the Svelte frontend to interact with the API.
Contributions are welcome! Please open an issue or submit a pull request.
This project is licensed under the MIT License.