Showing posts with label Eclipse. Show all posts
Showing posts with label Eclipse. Show all posts

Tuesday, December 22, 2009

A few tweaks and a gravatar

Two quick problems I solved today that were a bit naging.

When running the app server in Eclipse, it complained I didn't have the Python Image Library (PIL) installed.  Not a huge deal, I'm not going to use PIL now anyway, but I hate runtime errors however innocent they may be.  So I downloaded the PIL source.  Unfortunately I didn't have gcc installed either, so off I go to to find out how to install gcc.  Found an essential developers toolkit for the Mac, Xcode.  This package is great, installs all the dev tools you know and love, and much more.  So with gcc now in place, I built and installed PIL using the instructions in the source.  Went well, and now I don't have an error message when I start the app server.

The second problem was the one I mentioned in the last post.  Everytime I ran the server from within Eclipse, I got this error message.

Variable references empty selection: ${project_loc}

Turns out you need to keep focus on the project as you run it.  So make sure the main project is selected in the package explorer before you execute the Run command.  I suppose this makes sure the ${project_loc} is set.  It sort of makes sense, but is still a little weak.  Thanks to juddsolutions blog post for pointing this out.  It wasn't a Pydev problem after all, we all had to deal with it.


Got a great piece of code from snipt, allowed me to add Gravatars in just about 5 minutes.  It was that easy.


Lastly, if anyone has used django_tables successfully with eclipse and pydev, please let me know.  I installed it correctly, but running the app server from within eclipse throws an error that the library is not found.  It is clearly in the path, both source and runtime (Run) path.  Don't know what is going on.

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