This repository contains a website project that displays the current weather of a city, along with a 5-day weather forecast.
The project is built around the Django framework, which handles backend logic and data management. The user interface is developed using HTML for structure, CSS for styling, and JavaScript for dynamic interactions. Python is used to fetch weather forecast data from an external API.
The project also utilizes the python-dotenv library to manage environment variables, enabling easy configuration of API keys and other sensitive information.
Follow the steps below to set up and run the project locally:
git clone https://github.com/nuzael/weather.git
cd weather
On Linux:
python -m venv venv
source venv/bin/activate
On Windows:
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
Rename the .env.example
file to .env
and fill in the necessary information, such as API keys.
python manage.py migrate
python manage.py runserver
Open your web browser and navigate to http://127.0.0.1:8000/ to see the site in action.
static/: Contains static files, such as CSS and JavaScript files.
templates/: Stores the HTML files used to render the pages.
weather_app/: The main Django app that handles application logic.
urls.py: Defines the available URLs for the application.
views.py: Contains view functions that control the flow of data between the backend and frontend.
models.py: Defines the data models used in the app.
utils.py: Contains helper functions, such as API calls to fetch weather forecast data.
manage.py: Django management utility.
If you wish to contribute improvements to this project, feel free to create a pull request. Make sure to follow development best practices and document the changes you make.
This project is under the MIT license. Refer to the LICENSE file for more information.