title: push notifications with django and GCM
body: <p>I have a android client app, and my server is in django.</p>
  
  <p>I want to implement push-notifications in the server, to notify the specific users when changes in data related to them are happening, for example.</p>
  
  <p>I have found those links:</p>
  
  <ul>
  <li><a href="https://django-gcm.readthedocs.org/en/latest/quickstart.html" rel="noreferrer">https://django-gcm.readthedocs.org/en/latest/quickstart.html</a></li>
  <li><a href="https://github.com/bogdal/django-gcm" rel="noreferrer">https://github.com/bogdal/django-gcm</a></li>
  <li><a href="https://github.com/jleclanche/django-push-notifications" rel="noreferrer">https://github.com/jleclanche/django-push-notifications</a></li>
  </ul>
  
  <p>Not really sure what which link I need and for what. </p>
  
  <p><strong>An example for what I want is:</strong></p>
  
  <p>A user makes a request to server and changes data, and the server sends a push notification to another user.</p>
  
  <p>So what package should I install? and maybe any tutorials to follow??
  I am looking for any info to help me.</p>
  
  <p>thanks a lot!</p>
  
  <p><strong>--- EDIT ----</strong></p>
  
  <p>So I did as e4c5 suggested, and I have a table which contains Device ID coupled with user.</p>
  
  <p>I register the device to the GCM when app is installed. 
  I am also adding the Device_id to the table in my database (with the user field being <code>null</code> for now) and save the Device_id  in my client app as well.</p>
  
  <p><strong>Now, when a user logs in, I send a request to my server which couples the logged in user with the Device ID.</strong></p>
  
  <p><strong>When the user logs out - the user field is <code>null</code> again.</strong></p>
  
  <p>Problem is - if UserA is currently logged out (not in my database) but should receive a notification - my server will look at the database -> Devices IDs table and wouldn't find the userA in any of the user fields (because he is currently logged out).</p>
  
  <p><strong>As a result - the notification will be lost (my server would not send it to the GCM).</strong> </p>
  
  <p><strong>Best would be if when the user logs in again, he will get all the notifications that were sent to him while he was logged out.</strong></p>
  
  <p>How can I do this?</p>
  
  <p>thanks!</p>