'How to identify whether website is accessed from same hosted server or different client machine

We have a website hosted in local intranet environment using Python webserver. In that website particular button should only be visible if user is accessing this website on the machine\server on which site is hosted.

If website is getting accessed from any other system of the network then that button should be hidden.

So is there robust way to find whether site is accessed from same server or different machine



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source