Sometimes I have to put text on a path

Saturday, July 2, 2011

first steps for dummies: google-appengine-mac-launcher; Google App Engine SDK for Python

This post is a tutorial for "dummies v0.0.0.1".
you will learn:
  • Google-appengine-mac-launcher - the Mac Launcher for Google App Engine  
  • Google Project Hosting.
  • the full steps from a code to your ""
Download the Google App Engine SDK for Python:
(version 1.5.1 - 2011-06-20)

GoogleAppEngineLauncher-1.5.1.dmg is an image disk of 12.3 MB (on your local disk;) ).
GoogleAppEngineLauncher is a Mac application (60MB on your local disk).
Google App Engine Launcher helps you develop and deploy web applications for Google App Engine using your Macintosh computer. Using the Launcher, you can create a new project, launch your editor to write code and change configuration, test your application, and upload your application to App Engine. The Launcher includes the complete App Engine software development kit, so it's all you need to get started.

--A) for the first use of this desktop program,  you get this message:
"The Google App Engine SDK contains command-line programs used by  Would you like symbolic links for these programs, such as, to be made in /usr/local/bin?
This action will replace links which may currently exist."
--------click OK
"Symbolic links in /usr/local/bin have been created for the following commands: 
In addition, /usr/local/google_appengine points to the SDK."
---------------click OK

--B)-----------a brief overview of this stand-alone  application  before diving:
 At this URL (, you can see the Launcher window with three projects. The first project is currently running locally on port 8080. The second project, selected, is running on port 8081. The Log Console for this project is also open. You can stop it, navigate to the local application in a browser, deploy it to, and see the project dashboard. The last project is not running.

--C)------ In the help menu, select "demos" item  and "guestbook".
Google App Engine Launcher includes a fully functional demo application (hello-guestBook) that you can create, run and modify (for this demo application with Go (and not Python): see

--D)-1)---The Python SDK includes a web server application that simulates the App Engine environment, including a local version of the datastore, Google Accounts, and the ability to fetch URLs and send email directly from your computer using the App Engine APIs. The Python SDK runs on any computer with Python 2.5, and versions are available for Windows, Mac OS X and Linux. (The Python SDK is not compatible with Python 3.)
The Python SDK (for Windows and Mac) includes Google App Engine Launcher, an application that runs on your computer and provides a graphical interface that simplifies many common App Engine development tasks.

Python App Engine applications communicate with the web server using the CGI standard. When the server receives a request for your application, it runs the application with the request data in environment variables and on the standard input stream (for POST data). To respond, the application writes the response to the standard output stream, including HTTP headers and content.
Let's begin by implementing a tiny application (hello) that displays a short message.

--D-2)---first steps "run"
 a)click on the menu item "demo" (Google App Engine Launcher):

b) click "run" and click "logs",
c) The local app server starts, and the green "running" icon appears next to the project in the project list.
Click the "Browse" button. A web browser window (chrome) opens with the demo application's home page:

d)Test the application: In the browser window, select the text box on the page, enter some text (i.e. "first ex-ample", then click the "Sign Guestbook" button:

The application responds by adding the message to the page:

Try again with another message:

--D-3)---first steps :To modify the demo application. "Iterative Development"
a) In the Launcher window, click the "Edit" button (or select Edit -- Open in External Editor)
A text editor (application "text edit") opens with the files for the project (app.yaml).

The directory "guestbook" contains 2 files:

In the text editor, open the file named "" (. Find the line containing "An anonymous person wrote:". Change the phrase to "ex-ample(anonymous) wrote:", or another phrase of your choosing 
Tip: You do not need to restart the local app server for most changes to application source files. If the server is still running from a previous step, you can leave it running.

Select the browser window, then reload the page. Previously entered messages are displayed, but with the new phrase ("ex-ample(anonymous) wrote:").

To view the log data for a project running under the local app server:
click the "Logs" button.

--D--4)----To deploy a project to Google App Engine:
If you have not already done so, sign in or register with Google App Engine (, then create an application ID for the application (see below).
Edit the project's app.yaml file to have the correct application ID (see the pictures below)
(YAML is a language:

Select the project in the project list.

Click the "Deploy" button (graphic UI of the google-appengine-mac-launcher; or use appcfg to upload and deploy your application code).

Account google app engine window:
An application ID = a name unique to this application. 
If you elect to use the free domain name, the full URL for the application will be

more :
(Uploading, Downloading, and Managing a Python App: the App Engine Python SDK includes a command for interacting with App Engine named You can use this command to upload new versions of the code, configuration and static files for your app to App Engine. You can also use the command to manage datastore indexes and download log data).


Starting update of app: hello-javascript, version: 1
Scanning files on local disk.
2011-07-03 18:12:17,212 WARNING ssl module not found.
Without the ssl module, the identity of the remote host cannot be verified, and
connections may NOT be secure. To fix this, please install the ssl module from .
To learn more, see . 
Password for Cloning 3 application files.
Uploading 2 files and blobs.
Uploaded 2 files and blobs
Compilation starting.
Compilation completed.
Starting deployment.
Checking if deployment succeeded.
Will check again in 1 seconds.
Checking if deployment succeeded.
Will check again in 2 seconds.
Checking if deployment succeeded.
Deployment successful.
Checking if updated app version is serving.
Completed update of app: hello-javascript, version: 1
If deploy fails you might need to 'rollback' manually.
The "Make Symlinks..." menu option can help with command-line work.
*** has finished with exit code 0 ***

You succeed!!!!
Your first "web application" is

Try the "Dashboard" button:
You can manage and monitor applications running on Google App Engine using the Admin Console from your web browser. You can open the Admin Console directly from the Launcher.
With the project selected in the project list (google-appengine-mac-launcher),
click the "Dashboard" button.
A web browser window opens with the Google App Engine Admin Console for the selected project.
I get this:
Some remarks:
  • 3 paths were created: 1) a favicon was not added (err 404) but its path was created, 2) the path "/" and 3) the path "/sign".
  • go to "application settings": 1) Cookie Expiration: 1 day (App Engine uses a cookie to keep users logged in to your application); 2) you can select the Authentication Options: google account API or Federated login (openId); 3) YOU CAN DISABLE or DELETE YOUR APPLICATION HERE (
--D--6)---------now you can modify the demo application:
Sometimes if you modify the ""
you MUST modify "app.yaml" (for example if you want to add static file as image saved in your local  directory "/image"):

--D--7)------shut down the local web server
To shut down the web server, make sure the terminal window is active, then press Control-C (or the appropriate "break" key for your console), or click Stop in Google App Engine Launcher.
You can leave the web server running for the rest of this tutorial. If you need to stop it, you can restart it again by running the command above.

in fact, this demo partially corresponds to  the hello-guestbook step by step "getting started":

    (Note: If you built your application using an earlier version of this Getting Started Guide, please note that the sample application has changed. You can still find the sample code for the original Guestbook application, which does not use ancestor queries, in the demos directory of the SDK)

--F--------To add an other existing Google App Engine project to the launcher in 3 clicks:

      1----Select the menu option File -- Add an Existing Project...(or: Press Shift-Command-N).
      2----The "Add Existing Application" dialog opens. Click the "Browse..." button next to the field "Path" to select the existing application root directory.
The application root directory is the directory containing the application's app.yaml file.

(Optional) Change the port number to use when running the local app server for this project. By default, a port number is selected that doesn't conflict with any other project in the Launcher.

      3---Click the "Add" button. The project is added to the Launcher project list.


No comments:

Post a Comment