Debugging Google AppEngine with PyDev in Eclipse
This assumes you have Google AppEngine, Eclipse & PyDev installed.
I’m gonna have to go back a bit on what I said about creating a python project in this previous post. Instead of creating individual projects for each app you intend to create, I found it much easier to create one project that encompassed my entire development directory. Also, I received a few emails on how I was adding PyAMF and the google sdk to get code completion support. > Prefs

I added the .egg file for PyAMF and I zipped up the google folder underneath my appengine installation and added it.
Now onto debugging.
1. Create a new PyDev Project. Right click the project folder and Add New Folder. Click Advanced, Check the Link to folder and point it to the your appengine installation directory. Essentially your entire AppEngine Directory.

My project now looks like this

2. Now I open the project I want to debug and place my breakpoints.

3. Now right click on the dev_appserver.py file and go to Debug As > Open Debug Dialog.
Right Click Python Run and choose New.
Name the configuration
Select your Project
Add the dev_appserver.py as the Main Module

Then switch to the Arguments tab and enter the project you want to debug for the program arguments. You can also enter the —port=8080 switch here just like the command prompt.

Finally, Click Apply Then debug. You should see the following the Console:

Run your app. From Flex or from the Browser you should be able to hit your break points. Oh and I don’t recommend doing this to your arm or back.
Thanks for the tutorial Brian, very useful :)
Posted by: Thijs Triemstra | April 10, 2008 at 09:46 PM
Good thing you stopped me with that last 'step'. I just canceled my tat appointment.
Thanks.
Posted by: jeremy | April 10, 2008 at 11:01 PM
@Jeremy,
That'll happen.
Posted by: Brian Holmes | April 10, 2008 at 11:05 PM
Hi,
I've been debugging my google appengine app with PyDev. I added the google_engine dir to my PYTHONPATH, setup the main module as ${google_appengine}\dev_appserver.py, then the arguments:
Base directory : ${workspace_loc}
Arguments: ${project_name}
This way I have a project per application and I don't have to include the SDK's source.
Hope this is helpful.
Regards,
Nelson Silva
Posted by: Nelson Silva | April 12, 2008 at 12:12 PM
@Nelson,
Thanks for the tip. You're right that's much better.
Posted by: Brian Holmes | April 12, 2008 at 02:19 PM
You rock. Thanks!
Posted by: RobT | April 19, 2008 at 01:08 AM
I couldn't make like Nelson suggested. In Debug Dialog when setting "${google_appengine}\dev_appserver.py" to the Main Module field I got a "Unable to resolve location". How did you workaround?
Thanks in advance.
Posted by: Josue | May 27, 2008 at 07:09 PM