Google's App Engine is a cloud computing platform that allows you to deploy web sites on Google's servers. These notes provide the why and the how. Google Sites allows you to create a web site and store it on Google's servers. But sites created with Sites are limited:
App Engine is more difficult to use than sites, but it is more powerful in what you can build. Another system similar to App Engine is Amazon's Elastic Computing Cloud (ECC). These cloud computing sites provide everyone, even those without access to some company server, to put stuff on the web. Your TurnFor this exercise, you'll deploy a sample web site on Google's App Engine. The site is a static one, but it has a menu, some CSS styling, and some javascript to make the menus drop down. You can use this sample to build other sites, and part of your task will be to modify the code given here.1. Create a folder named samplesite within your home directory Within that folder, create the subfolders pages, images, css, and js. You're going to download some files and you'll need to put each file either the samplesite folder, or one of the subfolders, depending on the type of file it is.
2. Save the attachments at the bottom of this page (http://sites.google.com/site/usfcomputerscience/deploying-web-pages-on-app-engine). The easiest way is to right-click on them and choose 'Save Link As'. Be sure and name them exactly as they are named in the attachment, and to choose the proper subfolders as specified below: Save app.yaml and app_controller.py in the main samplesite folder. Save the two html files in the pages subfolder. Save the css files in the css subfolder. Save the .png and .gif files in the images subfolder. Save the .js file in the js folder. 3. Open a terminal. We'll use the Linux command-line terminal to start up a test server. To open a command-line terminal, choose Applications | System | Terminal from the top menu. A black window should appear. 4. Start the local test server by entering the following in the terminal window: dev_appserver samplesite 5. Test your application in the browser. The command above starts a development app server. This server is running on your local machine, but it acts as if it is a server somewhere on the Internet. You can test your program by opening a browser and entering the following URL in the address bar: http://localhost:8080/simplesample.html This will 'run' the program you just created by accessing the server you just started. 6. Deploy your application to Google. If you've made it this far, your web app works, but its really not on the web yet-- your browser is just accessing a 'test' server on your local machine. Now we'll upload your application to the web, and specifically Google's App Engine servers:
7. Test your deployed application. Go to a browser and enter the name of your application, followed by 'appspot.com/simplesample.html'. For instance, if your application identifier was 'DavesSample', then enter 'DavesSample.appspot.com/simplesample.html' in your browser. If
all is well, you should see a web page that looks the same as when you
ran your program with the development server. Only this time, your
application is really running on the web.
8. Modify Your Sample Application Your task for this second part is to personalize the sample site. You can create any type of site you want, but be sure and make the changes specified below. One possibility is to make a site introducing major project and linking to pertinent pages about it. a. Change the main menu to different menu headings and menu items of your choice. The menu appears in the HTML files within the pages subfolder. Open the simplesample.html file and search for links (<a href=...). You'll want to change these links. For instance, you could change the USF menu item to a link to Amazon by changing this code: <a href="http://usfca.edu">USF</a> to: <a href="http://amazon.com">Amazon</a> b. Add some real content, including text and images, to the body of the HTML pages. To do this, find the start of the body (<body>) and change the code between that and the end of the body (</body> c. Change the logo for the site. You can do this by creating a logo and saving it as logo.png in the images subfolder to overwrite the existing file. You can create a logo with GIMP on Linux, Fireworks on Windows, or any other drawing program. |