Django / Python: Real time peer to peer chat messaging <p>I use Django and Gunicorn to power my front end iOS applications. Up until now, I've been using simple GET, PUT, POST requests to send and receive json data from my iOS application to my Django server and vice versa. </p> <p>This setup has been solid however, I would like to implement real time messaging. When I first started out, I used APNS (Apple's Push Notifications Service) to deliver messages real time to recipients. Here is an example of what I used to do:</p> <p>If UserA messaged UserB, I would send the message to the Django Server via JSON, process it in a Django view, use <a href="https://github.com/samuraisam/pyapns">pyAPNS</a> - a python wrapper for APNS and it would send a push notification to UserB (the recipient) along with a payload size of 256 bytes. This worked well however it also has a few cons. </p> <p>If the recipient chooses to disable push notifications, then they will not receive the message. When you implement core data in your iOS app, this can be quite messy if you cache objects.</p> <p>So this leaves me with another option. Building something that is socket based that can work with Django and send the payload as JSON. Any ideas?</p>