views:

1488

answers:

7

Is it possible? By debug I mean setting breakpoints, inspect values and advance step by step.

+5  A: 

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.

Ned Batchelder
+5  A: 

You can do remote debugging of python web apps over TCP/IP with winpdb.

+3  A: 

One can debug applications built on Web2py using the following set-up:

  1. Eclipse IDE
  2. Install Pydev into Eclipse
  3. Set Breakpoints on your code as needed
  4. Within Eclipse right-click the file web2py.py and select Debug As -> Python Run
  5. When a breakpoint is hit Eclipse will jump to the breakpoint where you can inspect variables and step thru the code
Carl
A: 

Yes, it is possible, Due to the "span prevention" I am still not allowed to post screenshots, but here is a full screenshot hosted at my website:

http://static.techfuel.net/debug_web2py.png

Speedbird
+1  A: 

Follow this guide.

nFreeze
A: 

As Carl stated, it is as easy as: 1. Installing PyDev in Eclipse 2. Right Click on your Web2Py project, selecting Debug As > Python Run 3. Selecting web2py.py as the file to run

No other plugins or downloads are needed.

mudface
A: 

Here is an article on debugging python with pdb, which will work with web2py. http://sontek.net/debugging-python-with-pdb

sontek