Django Channels Tutorial 🔥: Real Time Graph with Chart.js | Django Websocket
HTML-код
- Опубликовано: 22 авг 2024
- This Django Channels Tutorial is about how to build Real Time Graph application using Django Channels and Chart.js.
In this Django Channels Tutorial I used a simple generator of integers, and then these integers are sent to frontend via Websocket protocol.
This Django Websocket tutorial is bit more practical demonstration of how to use Websockets with Django framework.
Also the Django Websocket and Django Channels tutorial is a Django Chart.js tutorial too.
It's a very simple Django Channels project.
Follow me @:
Telegram: t.me/red_eyed_...
Twitter: / codereyed
Facebook: redeyedc...
=== The source code is available via Patreon ===
/ django-channels-45356633
** Web Scraping course **
is available via Patreon here:
/ red_eyed_coder_club
or its landing:
red-eyed-coder...
** Other Django Channels 3 Tutorials **
- The most minimal Django Channels app: • Django Channels Tutori...
- Real Time Broadcasting API response: • Django Channels, Celer...
*** My Django 3 Tutorial ***:
• Python Django Tutorial...
➥➥➥ SUBSCRIBE FOR MORE VIDEOS ➥➥➥
Red Eyed Coder Club is the best place to learn Python programming and Django:
Subscribe ⇢ / @redeyedcoderclub
Django Channels Tutorial - Real Time Graph with Chart.js | Django Websocket
• Django Channels Tutori...
#django #djangochannels #djangochannelstutorial #redeyedcoderclub #pythondjango #python
What video should I make next? Any suggestions? *Write me in comments!*
Follow me @:
Telegram: t.me/red_eyed_coder_club
Twitter: twitter.com/CoderEyed
Facebook: fb.me/redeyedcoderclub
Help the channel grow! Please Like the video, Comment, SHARE & Subscribe!
Your Django tutorials always make so much sense, Thank You!
Thank you!
Wow this is amazing ! I had a project in mind to use graphs and this will be very useful, Thanks 😁
Thank you!
Олег я тебя узнал. Спасиба за урок !
Hey thanks for this video bro You are my new RUclips mentor ❤️❤️
Thank you!
the best one who explains Django thanks sir
Thank you!
This is the best training video for my runglish. Thanks you for it!
Thanks for this tutorial. Its a great help for my work.
Thank you!
Hey man, I love it I was thinking to create my own Django app to see lifetime stocks. Your tutorial is amazing please release more videos
Thank you!
Hey Farkhod, I'm also working on a similar project, but with crypto currency prices. Would you like to exchange some infos? I've already got the websocket data, but I'm not sure how to integrate it into the channels.
@@martahackerman1007 Did you watch this video: ruclips.net/video/wos1uhnd3qM/видео.html
@@martahackerman1007 yeah we could do that. Ping me on ING instagram.com/fsadykov_
@@martahackerman1007 bro can you give me some information about your project because I am working on same project and feel some issues in my project
Thks for this demo, So i need to show 2 line graph in real time with 2 websocket url !!
Amazing and simple .Thanks :D
Did this work on you computer?
Great. Brilliant. Can you pls make project how to update mqtt sensor data in django channel page
Thanks for very interested videos for django...
Thank you!
this is what i need. thank you
Thank you too!
could you please do when data is received from database because that's most people use case
Hi it is very helpfull my work. thanks a lot of
Glad to hear! Thank you for the comment!
You are real cool man!
Thank you!
Thank you so much!
Thanks for watching!
Thanks man. Could you please offer a book on Channels? I want more details on how it does work.
There is no one.
hi, thanks a lot for this tutorial,
i would to ask you how we can add live time in X-axis ?
To add live time you have no need in Channels and web sockets. It can be achieve by using frontend part only.
7:15 actual video starts
Thanks for comment
Thank you bro
Thanks for watching!
Great tutorial!
Could you please do an update where data is retrieved from a database rather than a random number?
Also, could you please do an update where RabbitMQ is used rather than Redis?
Thank you for your suggestions, I will think about it
@@RedEyedCoderClub i hope you do this🙏🙏
Is there any way where we can skip redis?
Also when I tried this example(until the redis part), if I close the tab and open a new on localhost (or refresh the same page) before all the websocket has stopped sending data(range(1000)), the page does not reload!
Instead of Redis you can use RabbitMQ.
Try to define the .disconnect() method in your consumer to handle the issue with a closed connection.
@@RedEyedCoderClub Okay I'll try that. Thank you.
Just wanted to ask that I'm sending live data continuously and when I refresh the socket connection gets closed..need help for this
very cool
Thank you!
19:45 start watching
thanks for comment
hi nice tutorial. i have a bit doubt and want to do something like for example we have 50 responses and to send back to same html page by different time. and i want to show successful response on html while other response are waiting.
response 1: value
response 2: loading
response 3: value
response 4: value
response 5: loading
something like it. can you tell me how can i achieve this in django. need it badly
I didn't get your question. Why others should be waiting? They will get the updated graph each time the server gets a new value.
@@RedEyedCoderClub i want to show 20 to 30 api response on same page with one click. and each api response has different time of return depends on api. and each api has different url. that's why i want to show user each api response when it's done so the user doesn't need to wait to complete all 30 requests.
Is there a way to receive data from external C# App continuously so the django app receive the data and display it in real time ?
Should be the way to do it. C# app should open a Websocket channel with 'ws://ip_address/etc'
@@RedEyedCoderClub Thank you my friend. Good channel !
Hi
I am trying to plot two runtime graphs on the same chart but not found any solution can you please suggest something.
Hi! Did you try to use several websockets for you data flows.
@@RedEyedCoderClub yes..i tried that too but first graph get freez when second works..
Websocket is a server ? ...how to integrate with another app.py file
No, websocket is a web protocol, that is used to send and receive data. What do you want to achieve?
Somehow the JavaScript file gets loaded in the html template but doesn't get executed
It's weird. Check your code, please.
how to real time display two values one chart?
The same way.
Look here there many examples and good documentation.
www.chartjs.org/samples/latest/
Hi
Hi
Hi there and thank you.
I have only a question, do you ever had the
Not Found: /ws/graph/ error?
Keep throwing this.
[13/Nov/2022 19:20:58] "GET /ws/graph/ HTTP/1.1" 404 2259
Check you code please
similar to me, I found error "GET /ws/graph/ HTTP/1.1" 404 2259
@@bisrimusthofa The error for me was caused because the app didn't start with 'Starting ASGI/Channels'. The fix for this was to use channels version 3.0.5, because by default now you get to install channels 4.0.5, which apparently doesn't work and causes this issue.
@@kristapsbable worked for me. thanks