App Engine: Qwik Start - Python

LAB 3

Overview

App Engine allows developers to focus on doing what they do best, writing code. The App Engine standard environment is based on container instances running on Google's infrastructure. Containers are preconfigured with one of several available runtimes (Java 7, Java 8, Python 2.7, Go and PHP). Each runtime also includes libraries that support App Engine Standard APIs. For many applications, the standard environment runtimes and libraries might be all you need.

Lab

Enable Google App Engine Admin API

To begin, enable the App Engine Admin API under APIs & Services.

Download the Hello World app

Enter the following command to clone the hello world app

git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git

Test the application

Now that the application is on the system, change to its directory and run it as shown below

cd python-docs-samples/appengine/standard_python3/hello_world
dev_appserver.py app.yaml

Now that the app is up and running, view it on port 8080 as shown below.

Modify Application

Modify the application and make it return something else.

cd python-docs-samples/appengine/standard_python3/hello_world
nano main.py

Once completed, head back to the site and preview the change.

Deploying Application

Now that we are happy with the changes, we can deploy the app to gcloud without much struggle as shown below.

The following command has to be run in the same directory where the app.yaml file exists.

gcloud app deploy

Viewing your Application

Now that its all complete, we can view our application with the following command

gcloud app browse

Last updated