Skip to content

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

License

Notifications You must be signed in to change notification settings

lutoma/django-wsync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

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

@stream
class WebspaceSerializer(ModelSerializer):
        class Meta:
                model = Webspace
                fields = ('host',)
>> 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.

About

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

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published