Pages

Wednesday, August 31, 2011

Cloud Computing : 'Hello World' Google App Engine Application in 5 mins

Your First Hello World Google App Engine Application in 5 mins


Author:Kaushik


Moving with our series on getting started with Google App Engine in this article we will talk about getting your first Hello World Application running and deployed on the App Engine. We will use python for this example and if you are already well versed in python you can skip the basics and move directly to the deployment steps for App Engine.

[caption id="attachment_258" align="aligncenter" width="300" caption="Cloud Computing Australia : Cloud Computing - Hello World Google App Engine Application in 5 mins"]Cloud Computing Australia : Cloud Computing - Hello World Google App Engine Application in 5 mins[/caption]

Step 1: Download and install the Google App Engine SDK for Python
Here is the link for the windows version.

Step 2: Create a simple helloworld python program

  • Create a directory named as helloworld

  • Create a file in this directory as helloworld.py which contains the code below


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

  • Create a configuration file called app.yaml in the directory with the following


 application: mytestapphelloworld
version: 1
runtime: python
api_version: 1

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

Step 3: Run the Hello World Application using Google App Launcher

  • Click on Programs Menu and start Google App Launcher

  • Click onFile Menu -> Add Existing Application

  • Add the HelloWorld directory as the application

  • Click Run to start the application and click on Browse to open the web page on the browser

  • You can also check http://localhost:8080/ to check the live running application


Step 4: Deploy your app on App Engine

  • Go to the App Engine url at https://appengine.google.com/

  • Login using your App Engine account that you had created from our earlier exercise

  • Create a new application by clicking on Create Application button

  • Use mytestapphelloworld as the application ID. If this is not available use a unique ID that you can remember

  • Update the app.yaml file with your application ID from above

  • Change the line below and replace mytestapphelloworld to your application ID.


application: mytestapphelloworld

  • Run the following command


appcfg.py update helloworld/

  • Enter your Google ID/password at the prompt.

  • Your deployed application is available at


http://mytestapphelloworld.appspot.com
Learn more at Technology Trends Blog

Article Source: http://www.articlesbase.com/online-education-articles/your-first-hello-world-google-app-engine-application-in-5-mins-2786396.html

About the Author

Kaushik Raghupathi is a senior IT Professional and Project Manager working out of India. Over the years he has worked on numerous IT projects with large sized teams. He is personally very fascinated around Learning methodologies in general and specifically around Community Based Learning. He is currently experimenting the concepts by working with students in this area.

http://www.peepaal.org

No comments:

Post a Comment