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.
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:
If UserA messaged UserB, I would send the message to the Django Server via JSON, process it in a Django view, use pyAPNS - 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.
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.
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?
Have you taken a look here:
https://pypi.python.org/pypi/django-socketio/
or here:
http://maxburstein.com/blog/realtime-django-using-nodejs-and-socketio/
or here:
https://www.djangopackages.com/grids/g/websockets/
It is possible to do.
Also, I don't see why real-time messaging has to be parsed within django itself. You could simply implement some node.js type server to handle this for you, with the iOS app pulling in data via different APIs. This will work, unless you need to keep messaging data attached to the other data.