Real-time model events via Websocket (Django channels)
The full documentation is at https://django-model-events.readthedocs.org.
Install django-model-events:
pip install django-model-events
Add ``model_events'' to ``INTALLED_APPS'' and include rounting:
from channels.routing import include from model_events.routing import routes channel_routing = [ include(routes, path=r'^/admin/ws'), ]
Include js to your template:
<script>var socket_uri = "/admin/ws";</script> <script type="text/javascript" src="{% static 'model_events/js/socket.js' %}"></script>
- TODO
Does the code actually work?
source <YOURVIRTUALENV>/bin/activate (myenv) $ pip install -r requirements-test.txt (myenv) $ python runtests.py
Tools used in rendering this package: