This is a weather application built with Django, inspired by the innovative design of Netflix. The application uses the Django framework and follows the MVC design pattern. It also includes user authentication features.
The application uses various APIs and AI technologies to provide users with accurate and up-to-date weather information. This allows users to make informed decisions based on the current and forecasted weather conditions.
the main sources for data in this project are Tomorrow.io API and BOM Weather. The data from BOM was sourced from the Python library, Weather-au.
The application's design is user-friendly and intuitive, making it easy for users to navigate and find the information they're looking for. The design is also responsive, ensuring a seamless experience on desktop, tablets, and mobile devices.
- View current weather information for various locations.
- User authentication.
- Responsive design that works on desktop, tablets, and mobile.
- API-powered weather predictions.
- Integration with various AI's for a better user experience.
- User-friendly and intuitive design inspired by Netflix.
- Routes and directions based on local weather.
-
Ensure you have Python 3.8 installed on your machine. You can download it from here.
-
Clone the Github repository using:
git clone https://github.com/nathan-perrier23/IA1-Weather-App-Django
-
Set up environment variables for configuration. These are stored in a
.env
file at the root of the
project. You'll need to create this file and add the following parameters. REMEMBER to change the API values and tocreate a Google project with VertexAI API enabled, also enable google places api
:CELERY_BROKER_URL = 'redis://:A45H2sg23hd2hdjhAG211hkyJKJ89@localhost:6379/0' CELERY_RESULT_BACKEND = 'redis://:A45H2sg23hd2hdjhAG211hkyJKJ89@localhost:6379/0' REDIS_HOST = 'redis' REDIS_BACKEND = 'redis://192.168.68.55:6379' SECRET_KEY = 'your-secret-key' OPENAI_API_KEY = 'your-openai-api-key' TOMORROWIO_API_KEY = 'your-tomorrowio-api-key' GOOGLE_MAPS_API_KEY = 'your-google-maps-api-key' MAPBOX_ACCESS_TOKEN = 'your-mapbox-access-token' EMAIL_HOST_USER = 'your-gmail-email' EMAIL_HOST_PASSWORD = 'your-gmail-app-password' OPENWEATHERMAP_API_KEY = 'your-openweathermap-api-key' GOOGLE_PROJECT_ID = 'your-google-project-id' GOOGLE_PLACES_API_KEY = 'your-google-places-api-key' DJANGO_SETTINGS_MODULE= weather_app.settings
NOTE: To use a Gmail account to send emails, you must set up an app password - but to do this you first need to enable 2-Step Verification, then select ‘App passwords’ under ‘2-Step Verification’. You must also turn on the ‘Less Secure App Access’ option in your google account.
-
create a virtual environment using
control + shift + p
then search create environment. After you have created the venv then restart vs code. -
Install the required Python packages using pip:
pip install -r requirements.txt
-
You will need to mirgrate the app using:
python manage.py makemigrations
then after that use:
python manage.py migrate
or if that did not work try use:
docker-compose run app python manage.py makemigrations
then after that use:
docker-compose run app python manage.py migrate
-
Navigate to the project directory and run the Django server:
python manage.py runserver
-
Open your web browser and visit
http://127.0.0.1:8000/
.
-
Ensure you have Docker (and optionally Docker Desktop) installed on your machine. You can download it from here. Make sure you start docker using
sudo service docker start
-
Clone the Github repository using:
git clone https://github.com/nathan-perrier23/IA1-Weather-App-Django
-
create a virtual environment using
control + shift + p
then search "create environment". After you have created the venv then restart vs code. Make sure you pip install libraries to the environment usingpip install -r requirements.txt
. -
Set up environment variables for configuration. These are stored in a
.env
file at the root of the
project. You'll need to create this file and add the following parameters. REMEMBER to change the API values and tocreate a Google project with VertexAI API enabled and to also enable google places api
:CELERY_BROKER_URL = 'redis://:A45H2sg23hd2hdjhAG211hkyJKJ89@localhost:6379/0' CELERY_RESULT_BACKEND = 'redis://:A45H2sg23hd2hdjhAG211hkyJKJ89@localhost:6379/0' REDIS_HOST = 'redis' REDIS_BACKEND = 'redis://192.168.68.55:6379' SECRET_KEY = 'your-secret-key' OPENAI_API_KEY = 'your-openai-api-key' TOMORROWIO_API_KEY = 'your-tomorrowio-api-key' MAPBOX_ACCESS_TOKEN = 'your-mapbox-access-token' EMAIL_HOST_USER = 'your-gmail-email' EMAIL_HOST_PASSWORD = 'your-gmail-app-password' OPENWEATHERMAP_API_KEY = 'your-openweathermap-api-key' GOOGLE_PROJECT_ID = 'your-google-project-id' GOOGLE_PLACES_API_KEY = 'your-google-places-api-key' DJANGO_SETTINGS_MODULE= weather_app.settings
NOTE: To use a Gmail account to send emails, you must set up an app password - but to do this you first need to enable 2-Step Verification, then select ‘App passwords’ under ‘2-Step Verification’. You must also turn on the ‘Less Secure App Access’ option in your google account.
-
You will need to mirgrate the app using:
python manage.py makemigrations
then after that use:
python manage.py migrate
or if that did not work try use:
docker-compose run app python manage.py makemigrations
then after that use:
docker-compose run app python manage.py migrate
-
Build the Docker image (ensure docker is running):
docker build -t weather_app -f DockerFile .
-
Run the Docker container:
For Deployment, use:
docker run -p 8000:8000 weather_app
or
docker compose watch
For Development:
docker run -p 8000:8000 -v "$(pwd):/app" weather_app
-
Open your web browser and visit
http://localhost:8000/
. -
When you make changes, you will need to rebuild the Docker images and restart the Docker containers. You can do this with
docker-compose down
and thendocker-compose up --build
.
If you are using Docker Toolbox, you will need to visit the IP address of the Docker Machine instead of localhost
. You can find the IP address by running docker-machine ip
in the terminal.
Use docker system prune -a
to remove all unused containers, networks, images (both dangling and unreferenced), and optionally, volumes.
This Project utilised various projects and resources, that can be seen in the REFERENCES file.
This project is licensed under the MIT License. See the LICENSE file for details.