An open API service indexing awesome lists of open source software.

https://github.com/lutoma/django-wsync

⚡ Easy real-time updates using WebSockets for Django/JavaScript projects
https://github.com/lutoma/django-wsync

django django-channels django-rest-framework websockets

Last synced: about 2 months ago
JSON representation

⚡ Easy real-time updates using WebSockets for Django/JavaScript projects

Awesome Lists containing this project

README

        

django-wsync
============

django-wsync streams changes in your Django models to your frontend using WebSockets. It is based on `Django Channels `_ and uses `Django REST framework `_'s serializers. It can also be integrated with JavaScript state management libraries such as `Vuex `_.

`📖 Documentation, installation and getting started instructions_ `_

Please note that this project is released with a `Contributor Code of Conduct `_. By participating in this project you agree to abide by its terms.

Example
-------

Note that this is missing imports. For a full example check `Getting Started `_

.. code-block:: python

class Webspace(models.Model):
host = models.CharField(max_length=50)

@stream
class WebspaceSerializer(ModelSerializer):
class Meta:
model = Webspace
fields = ('host',)

.. code-block:: js

>> wsync.connect()
>> wsync.store.Webspace[0].host
"beep boop"

Now, whenever an instance of your ``Webspace`` model is modified, the changes will be reflected in ``wsync.store``.