The most exciting thing about this world is its ever changing quality.

Thursday, March 12, 2009

Google app engine and all the jazz - Part I

It should not be too difficult to set up the development environment for google application engine. Since at the moment GAE only supports python as its compilation platform, and Eclipse is argubaly the most popular open source IDE with its nice plugin architecture, I decided to set out for the fun. After a beer and an hour effort, I found out Google has a post about the pretty much same setup :-).

First of all, to get Pydev installed in your Eclipse and you might also want to avoid problems in receiving console input while you are working under windows os by override the input() and raw_input() with the following functions:

def win_raw_input(prompt):
    return raw_input(prompt).replace("\r", "")

def win_input(prompt):
    return eval(win_raw_input(prompt))

Also should you want to be able to use console in Eclipse the same way as the interactive shell in python IDLE, here is the link to do so by setting up external tools. Now you can use Eclipse to do your python coding.

I am not going to repeat what has been described by Google's post. There are couple of other things though. Sometimes you will see this error by following the last step by adding user-defined starter for GAE development server using "${project_loc}/src".

This is caused by the fact that the project you are working get its focus snitched by Eclipse IDE.  I got annoyed after a few instances and decided to replace ${project_loc} with ${workspace_loc}\my_project_name\. Just to be aware that your yaml file should be located under your project root folder to allow dev_appserver to pick it up.

The other way is to use external tools to set up a configuration, i.e. "run Python for GAE". In the main tab of the program configuration, add the following parameters:

"C:/Program Files/Google/google_appengine/dev_appserver.py" 
--port=8080
"${workspace_loc}\HelloGAE\"
--port=8080

Now I am all set to rock and roll. 

No comments: