2021-03-07 17:32:00 +01:00
|
|
|
# Demo: HTML over WebSockets in Django
|
|
|
|
|
2021-03-07 17:30:41 +01:00
|
|
|
Demonstration of how to build a real time application using HTML over WebSockets in Django
|
2021-03-07 17:32:00 +01:00
|
|
|
|
2021-03-21 14:34:02 +01:00
|
|
|
|
2021-03-13 11:07:46 +01:00
|
|
|
![demo](demo.gif)
|
|
|
|
|
2021-03-21 14:34:02 +01:00
|
|
|
### Broadcast
|
|
|
|
|
|
|
|
![demo v2](demo-v2.gif)
|
|
|
|
|
2021-03-07 17:32:00 +01:00
|
|
|
## Article that inspired
|
|
|
|
|
|
|
|
https://alistapart.com/article/the-future-of-web-software-is-html-over-websockets/
|
2021-03-07 18:15:01 +01:00
|
|
|
|
2021-03-20 17:14:57 +01:00
|
|
|
## Explanation
|
|
|
|
|
2021-04-06 23:32:14 +02:00
|
|
|
### Spanish
|
|
|
|
|
2021-03-20 17:14:57 +01:00
|
|
|
https://programadorwebvalencia.com/html-sobre-websockets/
|
|
|
|
|
|
|
|
https://www.youtube.com/watch?v=02IjScPlDH0
|
|
|
|
|
2021-04-06 23:32:14 +02:00
|
|
|
### English
|
|
|
|
|
|
|
|
https://testdriven.io/blog/html-over-websockets/
|
|
|
|
|
2021-03-07 18:15:01 +01:00
|
|
|
## Run demo
|
|
|
|
|
|
|
|
``` bash
|
2021-03-13 11:07:46 +01:00
|
|
|
docker-compose -f docker-compose.dev.yaml up -d
|
2021-03-07 18:15:01 +01:00
|
|
|
```
|
|
|
|
|
2021-03-13 11:07:46 +01:00
|
|
|
Open
|
2021-03-07 18:15:01 +01:00
|
|
|
|
|
|
|
``` bash
|
2021-03-13 11:07:46 +01:00
|
|
|
my-demo.localhost
|
2021-03-07 18:15:01 +01:00
|
|
|
```
|
2021-03-20 17:14:57 +01:00
|
|
|
|
|
|
|
## Load fake data
|
|
|
|
|
|
|
|
``` bash
|
|
|
|
docker exec -it demo-html-over-websockets-in-django_django_1 python3 manage.py loaddata comments.json
|
|
|
|
```
|
2021-06-15 23:09:12 +02:00
|
|
|
|
2021-06-15 23:10:19 +02:00
|
|
|
## Interesting projects using this technique
|
2021-06-15 23:09:12 +02:00
|
|
|
|
2021-06-15 23:10:19 +02:00
|
|
|
Thanks @jbjuin
|
|
|
|
|
|
|
|
### Integrated with Django
|
2021-06-15 23:09:12 +02:00
|
|
|
|
|
|
|
- [django reactor](https://github.com/edelvalle/reactor): LiveView library for Django.
|
|
|
|
- [django sockpuppet](https://github.com/jonathan-s/django-sockpuppet/): Inspired by a ruby project (stimulus/reflex).
|
|
|
|
|
2021-06-15 23:10:19 +02:00
|
|
|
### Without Django:
|
2021-06-15 23:09:12 +02:00
|
|
|
|
|
|
|
- [idom](https://idom-docs.herokuapp.com/docs/index.html): HTML is generated using a Python syntax.
|