CherryPy is a “minimalist Python web framework” which allows web application to be developed easily. I had been using it since my Industrial Attachment to develop a web application to interface with Home Automation system. It has a built in web server and the best thing I like about CherryPy is that it is automatically “respawn” whenever I modified and saved the Python file. It is very convenient especially when I am doing testing with the web application.
So for this project, after much consideration and comparison with Web2Py, I decided to stick on this CherryPy framework.
I installed it on Raspberry Pi but I couldn’t access it from my laptop across the same network! So I had to bring Raspberry Pi down to lab and connect it up with the monitor and keyboard and mouse. Then I run tut_1.py and launched Midori. I am able to see “Hello World” on localhost:8080. But I still cannot access it from another comp on the same network.
Finally I figured out why and how to solve this problem. 🙂
- Open up the tutorial.conf in the same folder as the cherrypy tutorial python files.
- Change 127.0.0.1 (localhost) to 0.0.0.0 (IPv4 INADDR_ANY – listen on all interfaces)
- Save it. CherryPy will respawn.
- Now I am able to access the web app on another comp (on same network) using the rpi-ip-addr:8080 🙂