This Django web app can provide weather forecasts with chart display and notifications.
- Choose the city to get weather
- Display current weather condition
- Display current city map
- Display Forecast as a chart(5 day / 3 hour forecast)
- Set email notifications to notify the user if the temperature is below 45 °F
https://www.ranxiaolang.com/weather
If you find the online demo do not work, please follow the next part to run the code local.
- Clone this repository:
git clone https://github.com/nature1995/weather-forecast-alert.git
- 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
- 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
- Run server on your own computer:
python manage.py runserver 0.0.0.0:8000
- Access though browser
http://127.0.0.1:8000
or
http://0.0.0.0:8000
- Weather forecasts with chart display
- Notifications though email
- Show figure with Smoothed Line Chart or Histogram
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
nature1995 | Ziran Gong