How to debug Web2py applications?
I haven't used web2py, but if it runs in a terminal window, you can use standard pdb stuff. Add this line somewhere in your code:
import pdb; pdb.set_trace()
This will invoke the debugger and break. Then you can use PDB commands: n to step to the next line, l to list code, s to step into a function, p to print values, etc.
You can do remote debugging of python web apps over TCP/IP with winpdb.
(Link appears down as of June 2019. Try PyPI winpdb)
One can debug applications built on Web2py using the following set-up:
- Eclipse IDE
- Install Pydev into Eclipse
- Set Breakpoints on your code as needed
- Within Eclipse right-click the file web2py.py and select Debug As -> Python Run
- When a breakpoint is hit Eclipse will jump to the breakpoint where you can inspect variables and step thru the code