/Weather_portal

Using the weather application, the user can check the current weather conditions in the cities of his choice, after registering the user, the application allows you to view the weather from more than one city, receive weather allerts.

Primary LanguagePythonMIT LicenseMIT

Weather Portal

Final project of SDA python course: ZDPYTpol45

About

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.

Table of Contents

GETTING STARTED

  1. 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.
  2. 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
  3. 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
  4. Requirements

    • Once your virtual environment is activated and project is cloned you need to install requirements:
      pip install -r requirements.txt
  5. 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

USAGE

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

Features

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

Technologies Used:

- Python 3.9.0
- Django 4.0.4
- requests
- bootstrap 5
- Weather API - OpenWeatherMap

Languages and Tools:

bootstrap css3 django git html5 python sqlite

Project Status

Project is: in progress

Contributors ✨


Robert Adamczyk

💻

Grzegorz Jezierski

💻

Jacek Gielnik

💻

Screenshots

Home Site

XFXThl.md.png

Login

XFXxpf.md.png

Allerts

XFXII4.md.png

Select City

XFXokG.md.png

Show/Save City

XFXuQ2.md.png

License

MIT License.