Git Product home page Git Product logo

gae-pub-sub's Introduction

cloud-pubsub-samples-python

appengine-push

Note: The push endpoints don't work with the App Engine's local devserver. The push notifications will go to an HTTP URL on the App Engine server even when you run this sample locally. So we recommend you deploy and run the app on App Engine. TODO(tmatsuo): Better implementation for devserver.

Register your application

  • Go to Google Developers Console and create a new project. This will automatically enable an App Engine application with the same ID as the project.

  • Enable the "Google Cloud Pub/Sub" API under "APIs & auth > APIs."

  • For local development also follow the instructions below.

    • Go to "Credentials" and create a new Service Account.

    • Select "Generate new JSON key", then download a new JSON file.

    • Set the following environment variable.

      GOOGLE_APPLICATION_CREDENTIALS: the file path to the downloaded JSON file.

Prerequisites

  • Install Python-2.7, pip-6.0.0 or higher and App Engine Python SDK. We recommend you install Cloud SDK rather than just installing App Engine SDK.

  • Install Google API client library for python into 'lib' directory by:

$ pip install -t lib -r requirements.txt

Configuration

  • Edit constants.py
    • Replace '{AN_UNIQUE_TOKEN}' with an arbitrary secret string of your choice to protect the endpoint from abuse.

Deploy the application to App Engine

$ appcfg.py --oauth2 update -A your-application-id .

or you can use gcloud preview feature

$ gcloud preview app deploy --project your-application-id .

Then access the following URL: https://{your-application-id}.appspot.com/

Run the application locally

$ dev_appserver.py -A your-application-id .

gae-pub-sub's People

Watchers

Jorge Caballero avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.