A project to encapsulate the django example included in gevent-socketio into a resusable django application, compatible with the latest version of django, and not using the bootstrap pattern, opting instead for the traditional django application format.
Most of this code is ripped wholesale from socket.io and gevent-socketio, just packaged together by me.
Add "django_gevent_socketio" to your INSTALLED_APPS setting like this:
INSTALLED_APPS = ( ... 'django_gevent_socketio', )
Include the basic socketio URLconf in your project urls.py like this:
url('', include('django_gevent_socketio.urls')),
In your templates, load the scripts via a couple of simple tags, place the second tag somewhere near where your other JS is loaded:
{% load gevent_socketio %} ... {% socketio_js %}
The app provides a simple echo test to verify everything is working. To try this, add the following into your html:
<script type="text/javascript"> var socket = io.connect('/gevent_socketio_isworking'); socket.on("echo", function(message) { alert(message); }); socket.emit('echo', 'Some test message'); </script>
Run the gevent development server with (note, regular 'manage.py runserver' will not suffice):
./manage.py runserver_socketio
Refer to the test application ('django_socketio_tests') for very basic example. For more information and examples, refer to the sites above.
To the authors of socket.io and gevent-socketio