How the app works

Ever wonder how this all works but have no idea what the python means?


image

Above is the very start of the code this will import all the librays I need and then it sets all the variables for the Azure Key Vault to function this makes it so it "Just works" and means you dont need to have a api key but also makes it secure so I dont expose my keys publicly.


image

This part of the code sets and retrieves all the data from the openwether api as openwether returns a .json file the code needs to parse it then it puts all the weather info into a dictionary for the next part of the code


image

Next we set all the routs for flask there are 3 .html files that we use home.html get_weather.html and 404.html Home.html is a form that gets the city and country code the get_weather.html returns all the data of the response


This is the Home.html

image

This is get_weather.html

image

404 is not used yet so will be left out

Last updated