An open API service indexing awesome lists of open source software.

https://github.com/nature1995/weather-forecast-alert

🌈☁️Weather forecasts with chart display and notifications
https://github.com/nature1995/weather-forecast-alert

Last synced: 4 months ago
JSON representation

🌈☁️Weather forecasts with chart display and notifications

Awesome Lists containing this project

README

          

# weather-forecast-alert



[![Build Status](https://travis-ci.com/nature1995/weather-forecast-alert.svg?token=ihxd9jwdJ367UvYy3j9G&branch=master)](https://travis-ci.com/nature1995/weather-forecast-alert)

## Introduction
This Django web app can provide weather forecasts with chart display and notifications.

## Features
- [x] Choose the city to get weather
- [X] Display current weather condition
- [X] Display current city map
- [x] Display Forecast as a chart(5 day / 3 hour forecast)
- [x] Set email notifications to notify the user if the temperature is below 45 °F

## Demo

https://www.ranxiaolang.com/weather

If you find the online demo do not work, please follow the next part to run the code local.

## Run the code local:
1. Clone this repository:
```
git clone https://github.com/nature1995/weather-forecast-alert.git
```
2. Enter into `weather-forecast-alert` folder, set up virtual environment with **python 3.6** and install packages.
```
cd weather-forecast-alert
pip3 install -r requirements.txt
```
3. Update API key

OpenWeatherMap API key:
OWM_API_KEY: `./weather-forecast-alert/apps/weather/views.py`

Email key: (See email to find the latest key)
EMAIL_HOST_PASSWORD: `./weather-forecast-alert/Weather/settings.py`

4. Run server on your own computer:
```
python manage.py runserver 0.0.0.0:8000
```
5. Access though browser
```
http://127.0.0.1:8000
or
http://0.0.0.0:8000
```

## Result
1. Weather forecasts with chart display


Result01.png
Result03.png
Result02.png

2. Notifications though email


Result04.png
Result05.png

3. Show figure with Smoothed Line Chart or Histogram


Result06.png
Result07.png

#### Notice:
OpenWeatherMap API key:
OWM_API_KEY: `./weather-forecast-alert/apps/weather/views.py`

Google Map API key:
GOOGLE_MAP_KEY: `./weather-forecast-alert/apps/weather/views.py`

Set your Email:
Location: `./weather-forecast-alert/Weather/setting.py`
```
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.exmail.qq.com'
EMAIL_PORT = 465 # Your send port
EMAIL_HOST_USER = 'weather@ranxiaolang.com'
EMAIL_HOST_PASSWORD = 'Your Password' # Use the dedicate password not your email password
EMAIL_USE_SSL = True # SSL or TSL depend on email provider
```

## Author
[nature1995](https://github.com/nature1995) | Ziran Gong