Skip to main content

Google App Engine


Google App Engine lets you to run web applications on google's infrastructure without any cost. We dont need to maintain any server for our application here. App engine supports application written in several languages. The three important environments for app engine are Java runtime environment, Python runtime environment, Go runtime environment.

The main features of  Google App Engine are 

  • Dynamic web serving, with full support for common web technologies 
  • Persistent storage with queries, sorting and transaction
  • Automatic scaling and load balancing
  • APIs for authenticating users and sending email using Google Accounts
  • A fully featured local development environment that simulates Google App Engine on your compute
  • Task queues for performing work outside of the scope of a web request
  • Scheduled tasks for triggering events at specified times and regular intervals


The Python Runtime Environment 

Here we are going to discuss how to develop and upload applications with Google App Engine using the python environment. The python software development kit (SDK) has to be downloaded which includes a web server application that simulates the App Engine environment. Download the App Engine SDK and follow the instructions on the download page to install the SDK on your computer.

Creating a Google App Engine project

Let us discuss the procedure to create a web application using App Engine step by step.


  • Sign into the Gooogle App Engine using your google account and create an application. A unique application id is to be selected for a new application. 
  •  Create a directory named after the application id in your home directory.
  • Add the files  app.yaml, main.py and the application file
  •  Edit the app.yaml file as given below:
application: sampleprogram
version: 1
api_version: 1
runtime: python
handlers:

- url: /.*
  script: main.py 
Where sampleprogram is the application id.
  •  Edit the main.py file as follows:
import wsgiref.handlers
from google.appengine.ext import webapp
from google.appengine.ext.webapp import Request
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.ext.webapp import template

class main1(webapp.RequestHandler):
 def get(self):
           self.response.out.write(template.render("exampleprogram.html",{})) 
  
def main():
    app = webapp.WSGIApplication([
        (r'.*',main1)], debug=True)
    wsgiref.handlers.CGIHandler().run(app)

if __name__ == "__main__":
    main()
 Where exampleprogram.html is the actual application program.


Testing and uploading the application

You can start the web server with the following commant

google_appengine/dev_appserver.py "path to applicationid folder"the path is given to the sampleprogram directory

You can test the application by visiting the following URL in your web browser:



http://localhost:8080/
To upload your finished application to Google App Engine, run the following command:
    

appcfg.py update "path to applicationid folder
Now the application is set with the App Engine and can be accessed using the url http://your_app_id.appspot.com.

Comments

Popular posts from this blog

Backbone.js - An Introduction

Backbone.js is a lightweight JavaScript library that adds structure to your client-side code.  Developers commonly use libraries like Backbone.js to create single-page applications (SPAs).  What is a Single-Page-Application? A single page Web App is a website that attempts to recreate the experience of a native desktop or mobile application. On a Single Page Web App you are less likely to see page refreshes, the browser navigation within the app is often overridden and  there will usually be some offline capabilities. To a user their interaction with a Single Page Web App will be almost identical to how they interact with a full native application. Backbone has many advantages over other js frameworks. Backbone is mature, popular, and has a number  of plugins and extensions available that build upon it. It has been used to create non-trivial applications by companies such as Disqus, Walmart, SoundCloud and LinkedIn. Backbone organizes its whole code under t...

Elements of Programming in Scheme

A powerful programming language provides a framework to interpret our ideas of processes. It generally combines small procedures to complex ones. Usually there are three steps to accomplish this. primitive expressions , which represent the simplest entities the language is concerned with, means of combination , by which compound elements are built from simpler ones, and means of abstraction , by which compound elements can be named and manipulated as units. Some very basic ideas in manipulating with the data are given below. Expressions   A very simple expression is a number. Simple expressions are combined to form complex ones. For example:                   (+ 2  3  4) is an expression where + is the operation and 2,3,4 are the oparents. The expression can be made more complex by combining simple expressions as given below:              ...

Abstraction Using Higher Order Procedures

Procedures are, in effect, abstractions that describe compound operations on numbers independent of the particular numbers. Yet even in numerical processing we will be severely limited in our ability to create abstractions if we are restricted to procedures whose parameters must be numbers. Often the same programming pattern will be used with a number of different procedures. To express such patterns as concepts, we will need to construct procedures that can accept procedures as arguments or return procedures as values. Procedures as arguments Procedures are often used as the arguments of an another procedure. This provides a higher level of abstraction in programming. For example consider a procedure to find out the sum of squares of numbers between a range. The procedures inc and square are used as the arguments of the procedure sum, which is generalised as follows.                 (define (inc...