Django Channels Tutorial || Real-time Tables using WebSockets in Django | 2020

preview_player
Показать описание
#djangochannels #realtime #django
Real-time application is the most sought out functionality in any web application, In this video, I have created a realtime table data that gets updated from the backend without refreshing the UI.

00:20 Demo of the end result
01:37 Link to Redis server in Windows
03:00 Django basic application
04:54 Add channels in Settings
10:23 Add Consumers in the app
18:44 add logic on receive function
24:46 adding Table in UI using Javascript
37:00 Using WebSocket client to communicate
40:12 Websockets in Javascript
44:13 Updating tables using WebSockets

The course material is in github repo:

Рекомендации по теме
Комментарии
Автор

This is really great stuff, Thank you!

For WebSocket updates instead of sending the updates from the python code from the jupyter notebook, if you had used Django itself, that would have been more practical from Django point of view. Please make a tutorial on Django view updates that will trigger channels to send the data.

Again thank you so much for all your efforts. Learning a lot from you :)

aashayamballi
Автор

Thanks for Amazing Tutorial. I've seen both videos and code also

skysavani
Автор

well done sir, can we use channels to detect change in database? if so, please make the tutorial, thank you.

bramsalafist
Автор

Great tutorial bro.thanks for awesome contents

BaljeetKaur-kywk
Автор

Hi there,

Tahnk you for the tutorial, really really helpful. I am currently having an issue in the websocket part inside the jupyter notebook. When i try to run the second line i get the error message:


TypeError Traceback (most recent call last)
in <module>
1 import websocket, json, random
----> 2 ws = websocket.WebSocket()

TypeError: __init__() missing 3 required positional arguments: 'environ', 'socket', and 'rfile'

I tried to search google for an answer, but haven`t found one. In websocket documentation they say it should run normally. Any idea on how to solve this? Thanks again.

GabrielRibeiro-xrbx
Автор

Iam receiving data from api in views and prints to terminal works fine. I just want to send data from views to template real time

beshrumgaming
Автор

thank you very much !! helped me a lot

ronitjain
Автор

Hello there.
So I used everything I learned to make an APP of my own design here and wanted to deploy it to heroku, but i can't make it work. First because at deploying I encounter many errors, one of them is that twisted is not supported in heroku and is necessary for channels to run. Would you prepare a tutorial about deploying a real-time project like the one in the video?

Or could you point me out if I would have to use Heroku Redis and maybe other kind of code for deployment.

Thank you very much sir

GabrielRibeiro-xrbx
Автор

Amazing Tutorial. I followed both. And I was able to run them!

I have a question, It is possible to run the two "channels" in parallel?
I mean: Have the table refreshing and having the graph (showed in the previous tutorial) working in the same page, how can I achieve that?

marvinlopez
Автор

python -m pip install -U channels["daphne"]

ahmeddoudou
Автор

Can you set up video calling/chat using Django Channels and WebRTC? Please do a video about that, I'm sure everyone would want to know how to do that

akhillshetty
Автор

Great video. One doubt. Can django channels be used for video streaming between browsers using webrtc?

harshitsantosh
Автор

hii, do you have any tutorial of making charts dynamic in django???

prathyushavaigandla
Автор

Very helpful content, but I need to display real time data on my website, the scraping python program is ready, could you please help me by explaining how should I link these programs or is there a different method altogether for this?

ruylopez
Автор

I guess your virtualenv isn't working right. If you look at the req.txt file then you will know :/

AliHasanov
Автор

Can you get the data instead from your models and use celery to continuously run a task?

Speaksitself
Автор

The Websocket disconnects automatically after around 30-40 seconds, I'm sending the data through a scraper which takes about a minute to send. Where can I configure the timeout settings in django channels?

philmorgan
Автор

Please sir, can you make video on django + channels + socket in Hindi

dheeraj
Автор

when we are using async, how can we update the database?

sid
Автор

23:30, the subscriber is not able to connect, async def queue_factory() -> asyncio.Queue[str]:
TypeError: 'type' object is not subscriptable

ruylopez