Creating a Guestbook Application

This tutorial shows you how to build and run a sample Python application for App Engine and provides a code walkthrough of the sample code. The sample is a simple guestbook that lets users post messages to a public message board.

Objectives

  • Build and test an App Engine app using Python.
  • Integrate your application with Google Accounts for user authentication.
  • Use the webapp2 framework.
  • Use Jinja2 templates.
  • Store data in Google Cloud Datastore.
  • Deploy your app to App Engine.

Costs

App Engine has generous free quotas that will cover your testing this tutorial in a live production environment.

Before you begin

  1. Install Python 2.7.
  2. Download the App Engine SDK for Python.
  3. Sign in to your Google account.

    If you don't already have one, sign up for a new account.

  4. Select or create a Cloud Platform Console project.

    Go to the Projects page

  5. Note the Project ID, which is used in commands later in this tutorial.

Cloning the project from GitHub

  1. Clone the Guestbook application repository to your local machine:

    git clone https://github.com/GoogleCloudPlatform/appengine-guestbook-python.git

  2. Go to the directory that contains the sample code:

    cd appengine-guestbook-python
    

Building and running locally

To build and run the sample locally:

  1. Start the local development web server:

    dev_appserver.py ./
    

    The development web server runs, listening for requests on port 8080.

  2. Visit http://localhost:8080/ in your web browser to view the app.

    Click Login, then sign in with any email address. The development server accepts any email you supply, valid or not. This same code requires a valid Google Account and email when deployed to production.

  3. Stop the development server by pressing Control+C.

Send feedback about...

App Engine standard environment for Python