As we are now familiar with the web framework, let us perform a task that covers all the aspects that we saw earlier:
- We write a HTML page that asks for the username and password from the user. Those values will be passed into a Python script which will call the API that we created earlier to authenticate. If the return value is authorized, then we display the IP addresses of the devices that we want to view the additional information for on another web page.
- Next, the user can click on any of the IP addresses to view the show ip int brief output. If the authorization fails, the script returns the message Not Authorized and will not display the IP addresses. For reference (valid set of username and password):