Minimal example project for hosting p5 sketches locally with python (flask)
https://flask.palletsprojects.com/en/2.0.x/
If just running to test on local machine, simply run the python file and go to http://127.0.0.1:5000
If testing on local network, set app host to 0.0.0.0, e.g. app.run(host='0.0.0.0'), then navigate to the IP address of the host machine, e.g. if your PC's IP is 192.168.1.1, you could access the hosted page by navigating to http://192.168.1.1:5000 on your phone.