Google Cloud SDK – Creating a Guestbook Application

Google left out a lot of steps in their tutorial on using the App Engine to access a Datastore. Not only that, but if you want to run Python 3.x and 2.x on the same machine there are some simple ways to handle it that Google never explains. Here is the run down:

1. download and install python 3.x from the python website. this will include the py.exe python launcher
2. download and install python 2,x because Google doesn’t support 3.x when this was written
3. download and install the google cloud SDK and don’t use their bundled python option
4. when you open the google sdk command prompt, enter this to use the correct python version: SET PY_PYTHON=2

That’s it for the setup portion. Now for the real problem! You cannot execute the dev_appserver.py ./ python script and have it open a http server as expected. It will run and say something like “update#setState idle”
Also, you will get get an error (ERR_CONNECTION_REFUSED) trying to connect to locahost:8080. You need to do the following instead:

1. as mentioned in the install instructions for google cloud python sdk, you must install the missing python components using gcloud commands from a temp directory somewhere on your computer. This usually works:
cd %TEMP%
2. now enter the gcloud command:
gcloud components install app-engine-python
and when that is done get the extras because it didn’t work for me without them:
gcloud components install app-engine-python-extras
3. now you can run the dev_appserver.py but you have to use the py.exe launcher to make sure the correct v2 python exe is used, so change directories to where your project is and enter this command:
py “C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin\dev_appserver.py” ./app.yaml
4. open a web browser and go to http://localhost:8080 to see the results

Author: sirspot

I write software, love my wife and kids, do various house projects, play video games when I have time, and could use a little more sleep