« Getting Started on Google App Engine with Flex and PyAMF (2) | Main | Help! What to do without a Google AppEngine Account »

April 10, 2008

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

Pythondebug1

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.

Pythondebug2

 

My project now looks like this

Pythondebug3

 

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

Pythondebug4

 

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

Pythondebug5

 

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.

Pythondebug6

 

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

Pythondebug7

 

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. 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/t/trackback/2357234/27993514

Listed below are links to weblogs that reference Debugging Google AppEngine with PyDev in Eclipse:

Comments

Thanks for the tutorial Brian, very useful :)

Good thing you stopped me with that last 'step'. I just canceled my tat appointment.

Thanks.

@Jeremy,
That'll happen.

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

@Nelson,
Thanks for the tip. You're right that's much better.

You rock. Thanks!

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.

Post a comment

If you have a TypeKey or TypePad account, please Sign In