GithubHelp home page GithubHelp logo

ming86 / gae-python-gcm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gregbayer/gae-python-gcm

0.0 1.0 0.0 148 KB

Python-based Google Cloud Messaging backend for App Engine.

License: Other

gae-python-gcm's Introduction

About

gae-python-gcm is a simple implementation of Google Cloud Messaging for Google App Engine in Python.

This module is designed to take care of everything you have to think about when working with Android GCM messages on the server:

  • Takes advantage of App Engine's task queues to make retries asyncronous
  • Uses App Engine's memcache to collect error statistics
  • Provides two hook functions, delete_bad_token and update_token, which can be overridden or configured from a settings files to implement these actions in your environent.
  • Example django settings and testing / debug handlers.

Implementation with / without django

gae-python-gcm can be used with or without Django. The provided example was taken from a django-nonrel enviroment and is based on the way we use it at Pulse. If you want to use it with App Engine's built-in Django or without Django at all, it should be relatively simple to take the core functionality in /gae-python-gcm/gcm.py and leave the rest. Feel free to contact me if you have any quesitons (@gregbayer).

Why not use Google's GCM Server referance implmentation

We prefer to keep everything in Python instead of using the GCM server referance implmentation in Java.

Example

from gae_python_gcm.gcm import GCMMessage, GCMConnection

gcm_message = GCMMessage(push_token, android_payload)
gcm_conn = GCMConnection()
gcm_conn.notify_device(gcm_message)

Getting started

To add gae-python-gcm to your AppEngine project without Django:

  1. git clone git://github.com/gregbayer/gae-python-gcm.git
  2. Add entries to your app.yaml and queue.yaml based on included files.
  3. Copy the gae-python-gcm directory into your appengine project
  4. Make sure you set YOUR-GCM-API-KEY in /gae_python_gcm/gcm.py or in the settings module.

To add gae-python-gcm to your AppEngine project with Django:

  1. git clone git://github.com/gregbayer/gae-python-gcm.git
  2. Add entries to your app.yaml and queue.yaml based on included files.
  3. Copy the gae-python-gcm directory into your appengine project
  4. Configure your project as appropriate. You may find the urls.py and settings.py examples in the example_django_files directories useful.
  5. Make sure you set YOUR-GCM-API-KEY in /gae_python_gcm/gcm.py or in the settings module.

gae-python-gcm's People

Contributors

gregbayer avatar

Watchers

 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.