Google Appengine rocks!

Since Google announced Appengine, we are all excited about the upcoming news.
In this article i want to share some tips for getting started with appengine.
Following tips are : general information and registering to appengine, using App Engine SDK, creating your first app and deploying your baby.
* General info and Sign up.
Why app engine ?
App Engine enables developers to build web applications on the Google’s infrastructure. It’s pretty easy to build and maintain but the best part is it’s easy to scale as site traffic and data storage needs grow, another great point, getting started with app engine is free. so let’s get started.
Browse: http://appengine.google.com
and login with your google account, then press create an application button and enter your app identifier. (yourapp.appspot.com ) then here we go, you have it .
* App Engine SDK
App Engine SDK, brings you a development enviroment for quickly testing your apps locally. As soon as you setup the SDK you will find Appengine Launcher. Launcher is really easy to use development tool, it reminds me the old ruby on rails locomotive development app that I have been using in Tiger OS. It simply creates a new application, runs your application locally ( you can configure which port number your application will use via launcher. ), logs server request for debugging and then deploys to google.
download a beautiful SDK from : http://code.google.com/appengine/downloads.html
* Creating you first app
I highly recommend watching Google’s official first application video on youtube.
I assume that you have watched the video, now you saw how to write a quick guest book.
- How to add static content like css and images?
in your application directory create a folder and name it as “static”. this is not a rule, but everybody does that don’t discuss :) now open your app.yaml and under handlers tell application your static folder path,
handlers:
- url: /static
static_dir: static
that’s all. now you can put your images or css files inside static directory.
- How about other data types on app engine?
On app engine be careful you are not connecting to a traditional database, but you are using app engine datastore via Model library, that gives you opportunity for using better data types. See available data types on appengine store.
http://code.google.com/appengine/docs/python/datastore/typesandpropertyclasses.html
Now assume you want to use GeoPtProperty for storing your users locations. like:
class UniqueVisit(db.Model):
location = db.StringProperty(required=True)
geoPoint = db.GeoPtProperty()
use GeoPt type for initializing GeoPtProperty, Assume values for locate = “istanbul”, lat=41, lon=38 .
visit = UniqueVisit(location = locate, geoPoint = db.GeoPt(lat,lon) )
* Deploying your app is also easy.
Ensure your local development application’s name is same as your application identifier that you registered to google.
Press deploy and enter your google account. that’s all you have an application up and running on app engine.
cheers.
Guvener
If you enjoyed this post, make sure you subscribe to my RSS feed!
Flickr







Recent Posts
Subscribe to my blog