Google App Engine Test Drive


I heard about Google App Engine (GAE) almost immediately upon it’s release but due to the fact that access to it was invitation only and a high workload at the time, I didn’t bother trying it out. Both of those things changed recently so I setup my development environment and took it for a brief spin.

The first thing that struck me was that GAE is currently a Python only environment. I find this somewhat surprising since Google Web Toolkit is a star player in the user interface development arena plus it’s my understanding that some of the larger applications within Google are written in Java.

Regardless, for those that develop in Java and are interested in GAE I recommend setting a star on this issue (significant is that this is issue number 1 for the Google App Engine project).

Anyway, let’s move on to some nuts and bolts programming.

I use Eclipse as my IDE (Integrated Development Environment) so I found a very helpful blog post on setting up Eclipse for Python and GAE development. There are a couple of other articles that I found through Google search but this one covered off on almost all the details of making it work the way I prefer including setting up the “Run” target to run the development server within the IDE.

Something that I added in addition to the run configuration (which, by the way, shows up a debug configuration as well) was setting up the appcfg.py utility so that I could run it from my IDE. The appcfg.py script manages the process of deploying to the Google hosted environment.

Setting up another run configuration in Eclipse is easy enough since all you have to do is setup another Python run configuration in the Run dialog that points to the appcfg.py script.

Here is what the “Main” tab in my run configuration looks like:

And here is the “Arguments” tab:

The other nice thing about setting up the IDE this way is that the “Run” configuration show up on the “Run” menu for easy access:

This makes it easy to re-run the targets and you can order them to suit your preferences by using the “Organize Favorites…” menu item.

Anyway, once I had the basics of my development environment setup it was time to start a project. I used the new project wizard that comes with the PyDev Eclipse plug-in to create a project. I chose to name it cx-test-1.

Next in I wanted to create a GAE specific stub to test basic functionality of my development environment. The GAE SDK comes with a project stub fold called “new_project_template” so I manually copied the contents of that folder into my project source folder then pressed “F5″ in Eclipse to make the IDE aware of the new files. Here’s what my project looks like at this point:

Because the new project template contains a simple “hello world” program, we can run it as well as publish it to the deployment environment. I’ll leave how to start the development application server to the reader assuming that you have already gone through the process in this article.

To go beyond this point, you must have a Google App Engine account to deploy your application.

In order to use the appcfg.py script from the IDE, I had to run it from the command line first so that it caches the password. For those who need some help, on Windows you can press WinKey+R to open the “Run” dialog and type in “cmd” (this assumes you are using Windows 2000, XP and possibly Vista; I don’t know about the latter since I haven’t used it). In the command window, change to the project directory and run the command appcfg.py --email=me@domain.com src:

You should be prompted for your password which you should enter. Note that the password will be cached in your home directory in a file named .appcfg_cookies.

Once you’ve deployed the application you can access it on the app with a URL in the form of http://your-app-id.appspot.com. So mine can be accessed at http://cx-test-1.appspot.com

That’s the basics . I’m still not certain what value a hosted Python application server delivers for me at the moment since most of my work is using Java and GWT and GWT-Ext but I plan to continue to work with this system and writing something a little more complex that “Hello World” to get a better understanding. Stay posted…

Information and Links

Join the fray by commenting, tracking what others have to say, or linking to it from your blog.


Other Posts
Pictures: Week of May 26th
Ubuntu Laptop Flop

Write a Comment

Take a moment to comment and tell us what you think. Some basic HTML is allowed for formatting.

Reader Comments

Be the first to leave a comment!