As part of the Udacity's web developement course, the problem set 1 required the online student to submit his/her first web app by using Goole app engine. Here are my step-by-step to make "hello word" (actually it is "hello udacity") application by using Google app engine (python version) on Ubuntu 12.04.
What is Google App Engine? From the Google definition, Google App Engine lets you run web applications on Google's infrastructure. App Engine applications are easy to build, easy to maintain, and easy to scale as your traffic and data storage needs grow. With App Engine, there are no servers to maintain: You just upload your application, and it's ready to serve your users
Installation
Step-by-step:- Download the Google App Engine from http://code.google.com/appengine/downloads.html
- Install the Google App Engine, on Ubuntu:
- Make path to our Goole App Engine, change the computer name with yours.
- Make the path permanently
$ unzip google_appengine_1.7.7.zip $ mv google_appengine ~
export PATH=$PATH:/home/computer_name/google_appengine/
/home/computer_name/.profileThen, in .profile once again input the path in step 3:
export PATH=$PATH:/home/computer_name/google_appengine/
Writing the first App
Step-by-step:- Make your Google App Engine folder, for example
- Make the sub-folder in apps with the app project name, for example is mine
- Create file app.yaml in folder btatmaja
- Make your first Hello word in index.py
$ mkdir google_appengine/apps
$ mkdir google_appengine/apps/btatmaja
application: btatmaja version: 1runtime: python27 api_version: 1 threadsafe: false handlers: - url: /.* script: index.py
print 'Content-Type: text/plain'print '' print 'Hello Udacity'
Testing the application
Step-by-step;- Start the Google web server app engine with the following command followed by your app name (folder). Please look at your current directory, and add the additional scripts
dev_appserver.py btatmaja/That will start web server app engine, check it in your web browser by typing: localhost:8080/ . If you got the following your web app in local machine is done, continue it to upload in real Google web server.
Hello world app in local machine |
- Upload your app to real Google web server (Consider you current directory). Fill your Google account and password.
- It's done. Check the app in http:btatmaja.appspot.com (replace 'btatmaja' with your app name).
appcfg.py update btatmaja/
gcloud app deploy btatmaja/*
gcloud app deploy
Hello world app in Google Appspot |
Update:
- As October 2017, I tried this again, now is simple because it has repository for Ubuntu/Debian and can be installed by apt/apt-get. Now we can use `gcloud` inside Ubuntu terminal
Source:
- http://askubuntu.com/questions/123553/how-to-install-google-appengine
- http://www.oreillynet.com/pub/a/web-services/excerpts/9780596800697/run-google-app-linux.html