{ "info": { "author": "Ashley Wilson", "author_email": "scifilem@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3" ], "description": "=============================\ndjango-socket-server\n=============================\n\n.. image:: http://img.shields.io/travis/CptLemming/django-socket-server.svg?style=flat-square\n :target: https://travis-ci.org/CptLemming/django-socket-server/\n\n.. image:: http://img.shields.io/pypi/v/django-socket-server.svg?style=flat-square\n :target: https://pypi.python.org/pypi/django-socket-server/\n :alt: Latest Version\n\n.. image:: http://img.shields.io/pypi/dm/django-socket-server.svg?style=flat-square\n :target: https://pypi.python.org/pypi/django-socket-server/\n :alt: Downloads\n\n.. image:: http://img.shields.io/pypi/l/django-socket-server.svg?style=flat-square\n :target: https://pypi.python.org/pypi/django-socket-server/\n :alt: License\n\n.. image:: http://img.shields.io/coveralls/CptLemming/django-socket-server.svg?style=flat-square\n :target: https://coveralls.io/r/CptLemming/django-socket-server?branch=master\n\nDjango Socket Server\n\nQuickstart\n----------\n\n1. Install `django-socket-server`::\n\n pip install django-socket-server\n\n2. Add `socket_server` to `INSTALLED_APPS`::\n\n INSTALLED_APPS = (\n ...\n 'socket_server',\n ...\n )\n\nCreate a `sockets.py` in an application of your project.\n\n`django-socket-server` will discover the socket files that are in applications installed against Django.\n\nAn example `sockets.py` looks like this::\n\n from socket_server.namespace import EventNamespace\n\n\n class Namespace(EventNamespace):\n\n def client_connected(self, client):\n super(Namespace, self).client_connected(client)\n\n print 'Send ping'\n self.emit_to(client, 'ping')\n\n def register_callbacks(self):\n return {\n 'pong': self.pong\n }\n\n def pong(self, client, **kwargs):\n print 'Received pong event'\n\n\nMessages are sent and received in JSON, and always contain an `event` key. This key is then mapped to callbacks, added inside `register_callbacks`.\n\nYou can specify a namespace name using the name property like so::\n\n class Namespace(EventNamespace):\n name = 'pingpong'\n\n\nIf you do not specify a name, the app name will be used by default.\n\nStart Socket Server\n-------------------\n\nUse the management command provided to start the socket server: `python manage.py start_socket`.\n\nYou may pass an optional `--port` to override the default port of `3000`.\n\nClient connection\n-----------------\n\nThe above example would expose the following: `ws://localhost:3000/pingpong`\n\n\nDocumentation\n-------------\n\nThe full documentation is at https://django-socket-server.readthedocs.org.\n\nLinks\n-----\n\n- `Autobahn Python `_\n- `Twisted `_\n\n\n\n\nHistory\n-------\n\n0.0.1 (2015-01-01)\n++++++++++++++++++\n\n* First release on PyPI.\n\n0.0.2 (2015-01-30)\n++++++++++++++++++\n\n* Added python client classes\n\n0.0.3 (2015-01-30)\n++++++++++++++++++\n\n* Catch server shutdown and pass to namespaces\n\n0.0.4 (2015-02-01)\n++++++++++++++++++\n\n* Remove debugging and add \"room\" event errors", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/CptLemming/django-socket-server", "keywords": "django-socket-server", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "django-socket-server", "package_url": "https://pypi.org/project/django-socket-server/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-socket-server/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/CptLemming/django-socket-server" }, "release_url": "https://pypi.org/project/django-socket-server/0.0.4/", "requires_dist": null, "requires_python": null, "summary": "Django Socket Server", "version": "0.0.4" }, "last_serial": 1405032, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "48ccf80a6c4f8e22316024a4f117760c", "sha256": "00b135cbb5ab9af5e771c19faccd10edb5e1202e1e0af7bcc1dacceea7d8494e" }, "downloads": -1, "filename": "django-socket-server-0.0.1.tar.gz", "has_sig": false, "md5_digest": "48ccf80a6c4f8e22316024a4f117760c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8880, "upload_time": "2014-12-06T13:49:41", "url": "https://files.pythonhosted.org/packages/df/68/1c3d4e1eb26857f3437adb5cd3fb78a1016ab3d2cdef746009535bb66e4a/django-socket-server-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "df97a0607854fae8ee649b3f40207d75", "sha256": "366aed641edb95325469449472932827e98826aac8a3e5b0f7e1d6116c8e00fa" }, "downloads": -1, "filename": "django-socket-server-0.0.2.tar.gz", "has_sig": false, "md5_digest": "df97a0607854fae8ee649b3f40207d75", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9140, "upload_time": "2015-01-30T09:09:30", "url": "https://files.pythonhosted.org/packages/b2/8f/e2ec3637e019629976d1a6ef03fede77005977a52e4912633130ef6b91e6/django-socket-server-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "0a0e44f10d407fd6ddeeb340c9d571df", "sha256": "50261577ec8456c75668aa01115a2602f85f00be3f299d57967fd41deb59fe1e" }, "downloads": -1, "filename": "django-socket-server-0.0.3.tar.gz", "has_sig": false, "md5_digest": "0a0e44f10d407fd6ddeeb340c9d571df", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9157, "upload_time": "2015-01-30T13:42:15", "url": "https://files.pythonhosted.org/packages/56/18/15fd00cdcd0400e7d86aef915cbc10557392a7dc1084fcfef262d9006dd6/django-socket-server-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "ae713c48f776ecb1ff3dd74a98618884", "sha256": "f45f1c81941e8dfea534ff3d12197828dc956df196ae7934cc28df3cdeaeb694" }, "downloads": -1, "filename": "django-socket-server-0.0.4.tar.gz", "has_sig": false, "md5_digest": "ae713c48f776ecb1ff3dd74a98618884", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9168, "upload_time": "2015-02-01T11:29:13", "url": "https://files.pythonhosted.org/packages/80/b7/d5ad68cc2c75583c4dbe64eb5bb90503d50ae81ef408fda9b231e7293785/django-socket-server-0.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ae713c48f776ecb1ff3dd74a98618884", "sha256": "f45f1c81941e8dfea534ff3d12197828dc956df196ae7934cc28df3cdeaeb694" }, "downloads": -1, "filename": "django-socket-server-0.0.4.tar.gz", "has_sig": false, "md5_digest": "ae713c48f776ecb1ff3dd74a98618884", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9168, "upload_time": "2015-02-01T11:29:13", "url": "https://files.pythonhosted.org/packages/80/b7/d5ad68cc2c75583c4dbe64eb5bb90503d50ae81ef408fda9b231e7293785/django-socket-server-0.0.4.tar.gz" } ] }