Today I built the basic "Hello World" app as described on the code.google.com site. It was pretty straight forward, but a few little things that I had to work through. I wanted to use the Google App Engine plugin for Eclipse, but it is geared towards a Java dev environment, so don't bother installing this if you are using Python. The Pydev plugin I described in the last post is all you need.
First thing to do is look at this article that describes how to work through the tutorial using Pydev. The Google site is either generic or a bit Windows centric. Read the article to see how Pydev works with this tutorial and GAE. The only problem I had, and it is just my inexperience with the Mac, was getting the Mac file browser window to recognize any path. When the browser came up, you get the very user centered view of the filesystem, but you cannot browse to things like /usr/local/google_appengine which is what I needed to do to add the source trees to the project. After few searches I found the best key sequence ever, command-shift-g, it brings up a text box for any file path!
Next, start down the hello world app path. You start out with "Hello World", but quickly move on to a few more complex things. An excellent tutorial! You setup users, forms, and even persistent datastorage (through Bigtable). I learned a ton.
The only problem I continue to have is a Pydev problem I think. When I startup the app server from within Eclipse using the Python Run setup in the article, I get this error message about 90% of the time.
Variable references empty selection: ${project_loc}
Not sure why, ${project_loc} is just the location as defined by Eclipse, might be a Pydev problem. I'll look on stackoverflow later to see what is going on. Stackoverflow is a great site for programming questions.
Sunday, December 20, 2009
Friday, December 18, 2009
Setting Up
First blog entry, what is this thing about? I want to write a web application that runs in the Google App Engine. The more I read about this app engine infrastructure, the more I wanted to dive in. This thing sounds amazing, a rich set of APIs, use of Google tools like gmail, wave, picasa, etc. Google hosts the application, scales for you, manages your deployments. You even get to use the datastore that other Google applications use, Bigtable (BTW, read this paper, they really took an interesting approach to datastore design). It really does sound like an amazing environment to build and host web apps. So let's find out. That is what this is about. I'm going to go through a bunch of code, examples, ups-and-downs, and document them here.

First things first. Like any good project, the best part is buying tools. I love browsing the Sears Craftsman section and buying a new tool. For this project, I need a new computer. My old Dell just isn't going to cut it. So on "Black Friday" I went down to the Apple store and bought a 21.5 inch iMac, entry level, no upgrades. It is beautiful. Unix system, great interface, and even came with the new wireless keyboard and magic mouse. Here it is:
Next up are books. Google App Engine supports two programming languages. The first language implemented was Python, because it is used a ton at Google and the inventor of the language works there, the BDFL. GAE now supports Java as well. Java would have been an easy choice for me, I have programmed in Java since it's alpha version. But I would rather go with the language GAE is based on, and I would love to learn Python. So I bought the nutshell book that Alex Martelli wrote. This is a great book, but it is a programming language spec book. I like it because it gives you every detail about the language, syntax, structure, implementation. A full specification of how Python works. Highly recommended.
Now to setup the system. This was super easy on the Mac, what a great system. Python 2.6.1 comes installed with OS X 10.6 and although Python 3 sounds very interesting and has a lot of great features, but I am going to stick with 2.6 because the app engine doesn't support 3.0 yet. I installed Eclipse and the Pydev Python language plugin. Pydev even supports code deployment to GAE within the plugin! Setup was a breeze, I was coding in Python in a matter of minutes following the Pydev install and setup instructions. By far the easiest language/IDE setup I have ever done. (not counting vi & c)
Ok, so there is the setup. Pretty standard and a lot of fun. Next up I will go through the GAE tutorial. Over the course of the next few weeks I hope to go through the tutorial, and then create a simple application. I'm thinking an app to track my running progress (i am something of a recreational runner), should be simple enough. And really the world needs yet another web site that allows you to track your morning run :-)
Yours sincerely, Arthur "two-sheds" Jackson
Subscribe to:
Posts (Atom)