Weather app in Django that gets the current weather for multiple cities. To do this, I used Python Requests to call the Open Weather Map API.
Note: In this project I've used Python 3.7, so you need to install it first. It's highly recommended to use pyenv
for installation (if you're on MacOS).
It's best to use the python pipenv
tool to build locally:
Open up the files in your editor and add app weather
to the project within the_weather/settings.py
:
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'weather',
]
And then just startapp the app:
Open http://localhost:8000 to view it in the browser and go to admin panel
http://localhost:8000/admin/
The page will NOT reload if you make any edits.
Ypu can get your API from OpenWeather
To learn more on Django web framework visit Django.
Write your first Django app, check out the Writing your first Django app, part 1.
Creating a Weather App in Django Using Python Requests, check out this YouTube Tutorial Creating a Weather App in Django Using Python Requests.