Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

Endpoints Frameworks v2 Python Sample

This demonstrates how to use Google Cloud Endpoints Frameworks v2 on Google App Engine Standard Environment using Python.

Setup

Create a lib directory in which to install the Endpoints Frameworks v2 library. For more info, see Installing a library.

Install the Endpoints Frameworks v2 library:

$ mkdir lib
$ pip install -t lib google-endpoints

Deploying to Google App Engine

Generate a swagger file by running: python lib/endpoints/endpointscfg.py get_swagger_spec main.EchoApi --hostname your-service.appspot.com

To set up OAuth2, replace your-oauth-client-id.com under audiences in the annotation for get_user_email with your OAuth2 client ID. If you want to use Google OAuth2 Playground, use 407408718192.apps.googleusercontent.com as your audience. To generate a JWT, go to the following address: https://developers.google.com/oauthplayground.

Deploy the generated swagger spec to Google Cloud Service Management: gcloud alpha service-management deploy echo-v1_swagger.json

Open the app.yaml file and in the env_variables section, replace your-service.appspot.com with your service name, and 2016-08-01r0 with your uploaded service management configuration.

Then, deploy the sample using gcloud:

$ gcloud beta app deploy

Once deployed, you can access the application at https://your-service.appspot.com

Note that local deployment with dev_appserver.py is not yet supported with Endpoints Frameworks v2.