Tuesday, July 14, 2009

Running App_DevServer.py from Pydev

In my earlier post about setting up a Python Development environment for Google App Engine I mentioned I was going to explore using Aptana Studio for my Python for Google App Engine editing. So far this is going well and has been very easy to set up. Even better, for the moment PyDev seems to be bundled more or less exactly as it used to be when PyDev was independent. This is good news from the perspective that PyDev documentation and tips you can find online are still very valid.

Setup instructions for virgin eclipse installs:

  1. Go to the Aptana website and download the Aptana Studio standalone (if you have an existing Eclipse installation you can add it as a plugin as well).
  2. Install Aptana Studio
  3. From the 'My Aptana' homepage within Aptana, click on the Plugins section and click on the 'Get It' link for Aptana PyDev to install python support.
  4. From there, follow Joscha Feth's setup instructions from step 3 of Installing PyDev on Eclipse. These useful instructions explain how to set the Python interpreter correctly and what step you need for each project to bring in the Google App Engine python libraries and setup a Run configuration.
When I setup my Run configuration I ran into an issue where it seemed Eclipse was ignoring my specified arguments. When I ran the project, the dev_appserver.py script rightly complained it did not have the correct arguments.

After scouting out a couple of other websites (like this one) I cottoned on to the fact that if your project location path contains spaces, you need to place the argument in quotes, like so:

"${project_loc}/src"

This all makes perfect sense (and obvious), but in my case I was worrying the problem was something more serious. The fact that Eclipse/PyDev's own command-line inspection function was freaked out by the space (and therefore ended prematurely) meant I could not see the commandline which I hope would have clued me into the problem sooner.

The problem only took a few minutes to figure out, but maybe this post will assist someone else is spending 1 or 2 minutes less. Happy learning!

No comments:

Post a Comment