'Instruct WebApp using Django to run the code locally and return results

I am a newbie to web development and python scripts. I am learning to host python scripts using Django. I would like to know how to instruct Django to run the script locally instead of running it on the server.

For e.g. User visits the web app > enters parameters and submits the form > script should run locally from the client machine and return results back on the web app.

The purpose of my python script is to test the network port status locally on the user machine's private network and return the results.

Appreciate your advise.



Sources

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

Source: Stack Overflow

Solution Source