'How to trigger a python file using a URL?

I have a fresh installation of a raspberry pi and from a tutorial I was able to write a script that triggers my DSLR using gphoto2. I am able to run the script from the command line, successfully. I now want to add a button to a HTML page that fires this script:

<button onclick="firePythonScript()">Fire</button>

On the Pi I am able to install docker and nginx very easily.

What is the best way to connect the HTML page with the python script?

Finally, the HTML page should act as a trigger on a tablet, that fires the DLSR and all together acts as a Photo Booth.



Sources

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

Source: Stack Overflow

Solution Source