I have been using Django for a while. Recently, I came across Meteorjs and Emberjs. After looking at them I started wondering:

Could I combine Emberjs and Django to build reactive app like Meteorjs does?

How can Django project changes in its Models down to the browser?

有帮助吗?

解决方案

You could use Ember Data to represent your models in the browser which makes it easy to use a Restful interface to load and save your models.

If you want push changes from your Django server to the browser, you could use websockets or long polling to update the Ember Data models

其他提示

Depending on your project needs, I think you can consider djangorestframework-reactive (https://pypi.org/project/djangorestframework-reactive/1.0.0/). The plugin will enable you to display immediate data changes without the need for long polling. There is also the option of using celery with Redis to achieve an immediate response. Check out sample here: https://codesachin.wordpress.com/2016/01/04/redis-celery-reactive-computing-in-django-for-iot-applications/

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top