Using the weather application, the user can check the current weather conditions in the cities of his choice, after user registration, the application allows you to view the weather from more than one city. The user can change and reset the password via the received link to the e-mail. The app connects to the OpenWeather Api. The user has the option of displaying the city of his choice, saving it to the favorites and deleting the cities he has chosen. The system notifies the user of unsafe conditions, including high and low temperatures.
-
Checking Python version.
- To be able to use this script you'll need to have Python installed, you can check whether you have it installed or not by typing in terminal:
python3 --version
or:
python --version
- This script was written using version 3.9.0 and it is advised to use the same version.
- If you don't have Python installed you can go to Python.org to download it.
- To be able to use this script you'll need to have Python installed, you can check whether you have it installed or not by typing in terminal:
-
Creating Virtual Environment
- To create a virtual environment, decide upon a directory where you want to place it, and run the venv module as a script with the directory path:
python3 -m venv your-env
- Once you’ve created a virtual environment, you may activate it.
source your-env/bin/activate
- To create a virtual environment, decide upon a directory where you want to place it, and run the venv module as a script with the directory path:
-
Download
- You need to clone repository to your local destination
cd path/to/your/workspace
git clone https://github.com/zdpytpol45-project3/Weather_portal.git
- You need to clone repository to your local destination
-
Requirements
- Once your virtual environment is activated and project is cloned you need to install requirements:
pip install -r requirements.txt
- Once your virtual environment is activated and project is cloned you need to install requirements:
-
Make your secret key, API key in settings.py
In settings.py set:
SECRET_KEY = os.getenv('SECRET_KEY')
DEBUG = os.getenv("DEBUG") == "True"
In manage.py folder create .env file.
Add to .env file variables used in settings.py config:
SECRET_KEY = example_name
DEBUG = True
API_KEY = example_name
To use this application you need to type (if you're in your workspace directory):
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver
List the ready features here:
- user registration/login
- change password
- reset password
- registrator new user
- connect with OpenWeather Api
- let choose user one unique location by Latitude and Longitude (after choose city name)
- save city for logged users (without maximum)
- for not logged user show maximum 1 city
- make validator to check:
- city exist
- city already is in list
- delete button for user to delete city in saved user list
- notifies the user about dangerous conditions (low, high temp)
- add tests:
- test Model
- test response from api
- test POST
- Python 3.9.0
- Django 4.0.4
- requests
- bootstrap 5
- Weather API - OpenWeatherMap
Project is: in progress
Robert Adamczyk 💻 |
Grzegorz Jezierski 💻 |
Jacek Gielnik 💻 |
MIT License.