Development Environment

December 23, 2008

I’m not a fan of running the full server on my desktop. The server slows to a crawl after several minutes of running. I have created a test app out of one of my 10 I’m allowed to create. To test my code I simple use the appcfg.py and load the new code to the server. This only takes a few seconds and works really well. However, I ran into an issue with this approach today. The index.yaml does not update with indexes. The development environment updates this file with index you app will use as you test it out. If you take the same approach you will need to add lines like the ones I’ve listed:

indexes:

- kind: TheList
properties:
– name: created
direction: desc

You must add this above the #AUTOGENERATED statement in the file. Or run your program using the SDK and fully test it out.

App Engine Datastore Joins

December 20, 2008

While working on the site I found a need to join two tables together. I didn’t find many articles on how to do this, but did find the datastore has joins built in. The code below shows how to join a table using the ReferenceProperty. When you do this the record from the joined table becomes assessable via an object within the main record. This is a cool feature and makes database programing simple.

class Author(db.Model):
name = db.StringProperty()

class Story(db.Model):
author = db.ReferenceProperty(Author)

story = db.get(story_key)
author_name = story.author.name

First app now online

December 18, 2008

Today at 1:00 am est (now), I was able to place my first app online (www.WhereIsFlix.com – Netflix Video Tracking).  Python is growing on me.  Compared to PHP or ASP you have a good bit of control over how the app functions.  However, it’s not user friendly.  The language is easy to pick up and being OO allows the code to start off clean.

The tools Google provides could use some work.  While not hard to use the enviorement is somewhat klunky.  The SDK installs a full blown Python server on your PC.  Until I places a about 10,000 records into the Data Store the server ran quickly.  After adding records the server took up over 350 Megs of memory and responded slowley and at times would lock up.

The bulk loader (bulkload_client.py) is another area where improvement could be needed.  I was able to input zip codes with city, state, lat, and lon.  However only about 10,000 of the 40,000 were loaded into the datastore due to googles own code maxing out the cpu quota.    Loading this same data into the dev server running on my pc caused the shell to lock up several times.

Templates:  I love the seperation of code between the Python and the templates, but found this to be a new challenge as this was yet another language to learn.

Tomorrow:  I will be adding log in api’s to the code and trying to load the remaining 30,000 zip codes.

Google App Engine – Start

December 17, 2008

I started learning Google App Engine this week. I can’t resist a free service that offers hosting and powerful tools for development. The only issue I have currently is the need to learn a new language, Python. I read the google help and designed my first test app. This included downloading the SDK and setting up a small Python server that emulates the Google environment. I do have to say the entire process is fairly easy. I did created windows shell scripts to easily launch each test application.


Follow

Get every new post delivered to your Inbox.