In a previous article I noted how we were building simple interfaces to allow the production line and R&D to do certain tasks.
These tasks were affecting I/O to servos and switches etc, to automate or augment some tasks.
These tasks often relied on Python to do the I/O but we didn't want to use a built in interface like TKinter or WXPython. ... Not cool enough and a little slow.
So, we opted for a browser interface using LAMP. This was actually fine however it doesn't really make sense to have to use so many abstractions.
Most of the communication will be via JSON so the best solution was to simply use Python as a server. Seems simple enough.
And it was, ... with some caveats.
Any further communication goes through an AJAX route that checks if the requested method exists, runs it and returns the response as JSON.