Sunday, July 19, 2009

Web Application Development : Google Apps

What is Google App Engine ?

It lets you run your web application on Google Infrastructure. For more Detail move to google.

What make it out stand :

1. The best part is that it support Java and Python both.
2. You pay for for what you use.
3. No setup costs and no recurring fees.


Lets try our hand and built a very simple page.

Move to Google APP. You need to have a google (gmail) account.

Here come the first screen showing the button Create Application as shown.


Click on Create Application. And the follwing screen will come which will ask for the mobile number for confirmation.

The next screen will be asking for the application details.



Fill the application identifier (must be unique).




Give it a title. So that its easily understood. Press Save. A new screen saying application registration sucessfully will come.

So now all set. Download GoogleApp Engine toolkit. You have two option to go for java or python based on all type of machines.

I did with python as i have python installed :) . A zip file will be thr. Extract it.

If you are on linux make sure you have right permission for the folder.

Now create a directory with some suitable name.

Add three files
1. app.yaml
2. main.py
3. index.html

Add following lines to main.py

from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.ext.webapp import template
from google.appengine.ext import db
import cgi
import os
class Table (db.Model):
element = db.StringProperty()
class Index(webapp.RequestHandler):
def get(self):
template_values = {}
path = os.path.join(os.path.dirname(__file__), 'index.html')
self.response.out.write(template.render(path, template_values))
application = webapp.WSGIApplication([('/', Index)],
debug=True)
def main():
run_wsgi_app(application)
if __name__ == "__main__":
main()

Add following code to app.yaml

application: [your folder]
version: 1
runtime: python
api_version: 1
handlers:
- url: /.*
script: main.py

Add some content in the index.html. Put text like
"My First Page using Google App Engine"

Now time to test the application on browser

Move to yourGoogle App Engine (SDK) folder that you extracted earlier (Using Terminal, cmd)

Run following command and replace [your app] by your folder name.
./dev_appserver.py [your app]

Open the browser type http://localhost:8080

BINGO !! You made the application using Google Apps :)

For more details visit :



No comments:

Post a Comment

There was an error in this gadget