Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging web apps

I've gotten pretty used to step-through debuggers over the years, both in builder, and using the pydev debugger in Eclipse.

Currently, I'm making something in Python and running it on Google App Engine, and I should add that I'm pretty new to developing any real web app; I've never really done much beyond editing HTML code.

So, I'm running Google's dev_appserver and viewing my work at http://localhost, dig, and right now, the only tool I'm using to identify issues is PMD (poor man's debugger). . .basically writing things to the html pages to see the value of local variables.

Is there a better technique for dealing with this?

like image 206
Baltimark Avatar asked Feb 17 '09 17:02

Baltimark


2 Answers

The dev_appserver is just a python script, you can simply use the pydev debugger on that script with the proper arguments as far as I know.

Here is a very detailed guide on how to do that:

http://www.ibm.com/developerworks/opensource/library/os-eclipse-mashup-google-pt1/index.html

like image 144
TomHastjarjanto Avatar answered Sep 29 '22 11:09

TomHastjarjanto


I would suggest to use logging statements instead of prints though as you can control them better. Python has a quite good logging library included.

For logging from Google App Engine to e.g. Firebug there is also some handy tool called FirePython. This allows to log to the firebug console from within your Django or WSGI app (it's middleware).

like image 31
MrTopf Avatar answered Sep 29 '22 13:09

MrTopf