Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Android Cloud 2 Device Messaging module for Django
branch: master

This branch is even with scottferg:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.


django-c2dm is a Django module for sending push messages to an Android device using Cloud 2 Device Messaging. It provides a model to store the necessary information required to send a message through C2DM as well as several helper functions.


Using django-c2dm is easy. Add the following line to your file:


Where YOUR_PUSH_ACCOUNT_AUTH_TOKEN is the ClientLogin token for your push account.

And then add django_c2dm to your INSTALLED_APPS.

Finding your ClientLogin token

You can retrieve the ClientLogin token for your push account via cURL:

curl -X POST -d Email=ACCOUNT -d Passwd=PASSWORD -d accountType=HOSTED_OR_GOOGLE -d service=ac2dm

Just replace ACCOUNT and PASSWORD with the relevant information.

Copy everything in the response following Auth= to get your AUTH_TOKEN value.


To send a message to a device call send_message() on the model. send_message() only needs kwargs as a parameter. Use this to populate the data.X fields in your message. These fields will be provided as extras on the intent that the device receives.

You can also set the delay_while_idle parameter to True to enable this feature.

Something went wrong with that request. Please try again.