<a href='https://www.programmerfish.com/category/google/' target='_blank'>Google</a>_App_Engine_logo_wtxtCloud Computing is a buzz word now and every developer MUST know how to program and  deploy on the Cloud be it Google’s https://www.programmerfish.com/category/app-engine-google/' target='_blank'>App Engine or Microsoft’s https://www.programmerfish.com/category/windows-azure-microsoft/' target='_blank'>Azure or Amazon’s EC2. Here is a very simple tutorial on how to create Hello World (traditionally the very first app we write on anything new we learn) on https://www.programmerfish.com/category/app-engine-google/' target='_blank'>App Engine.

Since it took me some time figuring out a some details which were very vaguely defined on the official text-tutorial on Google Code, so I thought of explaining it to the very minute detail for all the starters out there.

Step One (Get the Essentials):
Download Python Release 2.5.4
Download Google https://www.programmerfish.com/category/app-engine-google/' target='_blank'>App Engine SDK

Once this is done then first install Python2.5.4 and then install Google https://www.programmerfish.com/category/app-engine-google/' target='_blank'>App Engine. Since the current https://www.programmerfish.com/category/app-engine-google/' target='_blank'>App Engine SDK was developed around Python’s 2.5.4 release so downloading and installing Python’s latest releases (2.6.X) will not work! This took me whole 2 hours figuring out what the problem could be! So make sure you download 2.5.4 release.

Step Two (Directory Structuring):
Create a directory named “helloworld” in “/google_appengine”. This directory will contain your application files.

Step Three (Code Writing):
Open Text Editor (Notepad) and copy the following code in it and save it as “helloworld.py

print 'Content-Type: text/plain'
print ''
print 'Hello, world!'

This is your application written in Python! All it does is print Hello World on the screen every time its called.

Now, in https://www.programmerfish.com/category/app-engine-google/' target='_blank'>App Engine, every application you write has a configuration file called “app.yaml”. This file maps the request urls to Python apps in your directory and does a couple of advanced configuration details of your app.

For now, we only want it to map every request to our helloworld.py file, so create a “app.yaml” file in your helloworld directory and write the following code in it:

application: helloworld
version: 1
runtime: python
api_version: 1

handlers:
- url: /.*
script: helloworld.py

The first four lines tells the web server about the application handler name, version (versioning your app is important since you want to release new versions too), runtime environment and API version. Leave these details for the moment.

The next three lines describe the mapping for your app: /.* means all requests will be mapped to helloworld.py file.

Step Four (Deployment on Web Server):
So everything is ready and now its time to deploy your first app on webserver.

The https://www.programmerfish.com/category/app-engine-google/' target='_blank'>App Engine SDK you downloaded comes with a web server so that you can deploy your applications on local machine before deploying them to the actual cloud.

Here is how it goes:

1) Open command prompt (type cmd in run) and go to the directory where you installed https://www.programmerfish.com/category/app-engine-google/' target='_blank'>App Engine. I have installed it in J:\ so I typed this:  cd j:\Google\google_appengine

Once you are in the directory, you have to start the webserver with your application deployed. Type in this:
dev_appserver.py helloworld/

The command prompt will look something like this:
image

Hurray! Web Server is started and your HelloWorld application is deployed in it! Now you can send requests to your app by opening the browser and typing in: https://localhost:8080

image

Next time I will explain how to deploy this app on https://www.programmerfish.com/category/app-engine-google/' target='_blank'>App Engine Cloud. Stay tuned.