Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug Web2py applications?

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

like image 741
Santiago Corredoira Avatar asked Nov 24 '08 19:11

Santiago Corredoira


2 Answers

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

(Link appears down as of June 2019. Try PyPI winpdb)

like image 76
tangentstorm Avatar answered Oct 04 '22 03:10

tangentstorm


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.

like image 8
Ned Batchelder Avatar answered Oct 04 '22 03:10

Ned Batchelder