diff --git a/README.md b/README.md index 478d8f0..8905a2b 100644 --- a/README.md +++ b/README.md @@ -2,18 +2,20 @@ Demonstration of how to build a real time application using HTML over WebSockets in Django +![demo](demo.gif) + ## Article that inspired https://alistapart.com/article/the-future-of-web-software-is-html-over-websockets/ ## Run demo -``` bash -docker-compose -f docker-compose.pro.yaml up -d -``` - -## Develpment - ``` bash docker-compose -f docker-compose.dev.yaml up -d ``` + +Open + +``` bash +my-demo.localhost +``` diff --git a/apps/back/consumers.py b/apps/back/consumers.py index aaba870..cd3cb71 100644 --- a/apps/back/consumers.py +++ b/apps/back/consumers.py @@ -6,15 +6,12 @@ from apps.back.models import Post, Comment class BlogConsumer(WebsocketConsumer): def connect(self): - ''' Cliente se conecta ''' self.accept() def disconnect(self, close_code): - ''' Cliente se desconecta ''' pass def receive(self, text_data): - ''' Cliente envía información y nosotros la recibimos ''' text_data_json = json.loads(text_data) selector = text_data_json["selector"] template = text_data_json["template"] diff --git a/apps/front/templates/layouts/main.html b/apps/front/templates/layouts/main.html index 7490272..f2578a0 100644 --- a/apps/front/templates/layouts/main.html +++ b/apps/front/templates/layouts/main.html @@ -32,16 +32,13 @@