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

Комментарии • 76

  • @RedEyedCoderClub
    @RedEyedCoderClub  2 года назад

    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!

  • @sn0wy173
    @sn0wy173 3 года назад +3

    Your Django tutorials always make so much sense, Thank You!

  • @srikarksv1317
    @srikarksv1317 3 года назад +5

    Wow this is amazing ! I had a project in mind to use graphs and this will be very useful, Thanks 😁

  • @dimobixgenchik2001
    @dimobixgenchik2001 Год назад +1

    Олег я тебя узнал. Спасиба за урок !

  • @aayushpatil7514
    @aayushpatil7514 3 года назад +2

    Hey thanks for this video bro You are my new RUclips mentor ❤️❤️

  • @alexdin1565
    @alexdin1565 Год назад

    the best one who explains Django thanks sir

  • @user-oq4bd8cg8o
    @user-oq4bd8cg8o Год назад

    This is the best training video for my runglish. Thanks you for it!

  • @sharminaiasmin8865
    @sharminaiasmin8865 Год назад +1

    Thanks for this tutorial. Its a great help for my work.

  • @fsadykov
    @fsadykov 3 года назад +1

    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

    • @RedEyedCoderClub
      @RedEyedCoderClub  3 года назад

      Thank you!

    • @martahackerman1007
      @martahackerman1007 3 года назад

      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.

    • @RedEyedCoderClub
      @RedEyedCoderClub  3 года назад +1

      @@martahackerman1007 Did you watch this video: ruclips.net/video/wos1uhnd3qM/видео.html

    • @fsadykov
      @fsadykov 3 года назад

      @@martahackerman1007 yeah we could do that. Ping me on ING instagram.com/fsadykov_

    • @vikasanwla4764
      @vikasanwla4764 2 года назад

      @@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

  • @hammoudamoujehed6112
    @hammoudamoujehed6112 10 месяцев назад

    Thks for this demo, So i need to show 2 line graph in real time with 2 websocket url !!

  • @user-coexist
    @user-coexist Год назад

    Amazing and simple .Thanks :D

  • @q-sharebd
    @q-sharebd Год назад

    Great. Brilliant. Can you pls make project how to update mqtt sensor data in django channel page

  • @nagarjunau4188
    @nagarjunau4188 2 года назад

    Thanks for very interested videos for django...

  • @doditsuprianto4304
    @doditsuprianto4304 3 года назад

    this is what i need. thank you

  • @michael_ibeh
    @michael_ibeh Год назад

    could you please do when data is received from database because that's most people use case

  • @merdanbazarow221
    @merdanbazarow221 2 года назад

    Hi it is very helpfull my work. thanks a lot of

  • @cheesecheesson9842
    @cheesecheesson9842 3 года назад

    You are real cool man!

  • @aashayamballi
    @aashayamballi 3 года назад

    Thank you so much!

  • @amircodes
    @amircodes 3 года назад

    Thanks man. Could you please offer a book on Channels? I want more details on how it does work.

  • @telliala
    @telliala 2 года назад

    hi, thanks a lot for this tutorial,
    i would to ask you how we can add live time in X-axis ?

    • @RedEyedCoderClub
      @RedEyedCoderClub  2 года назад

      To add live time you have no need in Channels and web sockets. It can be achieve by using frontend part only.

  • @rakeshnagarajan7701
    @rakeshnagarajan7701 2 года назад

    7:15 actual video starts

  • @basinccontrol
    @basinccontrol 3 года назад

    Thank you bro

  • @ulriknash5502
    @ulriknash5502 2 года назад

    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?

    • @RedEyedCoderClub
      @RedEyedCoderClub  2 года назад

      Thank you for your suggestions, I will think about it

    • @michael_ibeh
      @michael_ibeh Год назад

      @@RedEyedCoderClub i hope you do this🙏🙏

  • @ommahajan1
    @ommahajan1 3 года назад +1

    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!

    • @RedEyedCoderClub
      @RedEyedCoderClub  3 года назад +1

      Instead of Redis you can use RabbitMQ.
      Try to define the .disconnect() method in your consumer to handle the issue with a closed connection.

    • @ommahajan1
      @ommahajan1 3 года назад

      @@RedEyedCoderClub Okay I'll try that. Thank you.

    • @mozzaminamdar7143
      @mozzaminamdar7143 Год назад

      Just wanted to ask that I'm sending live data continuously and when I refresh the socket connection gets closed..need help for this

  • @user-pd2hm8jn4l
    @user-pd2hm8jn4l 2 года назад

    very cool

  • @olimbeknizomov8081
    @olimbeknizomov8081 2 года назад

    19:45 start watching

  • @djangodeveloper07
    @djangodeveloper07 2 года назад

    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

    • @RedEyedCoderClub
      @RedEyedCoderClub  2 года назад

      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.

    • @djangodeveloper07
      @djangodeveloper07 2 года назад

      @@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.

  • @metablastx5
    @metablastx5 2 года назад

    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 ?

    • @RedEyedCoderClub
      @RedEyedCoderClub  2 года назад +1

      Should be the way to do it. C# app should open a Websocket channel with 'ws://ip_address/etc'

    • @metablastx5
      @metablastx5 2 года назад

      @@RedEyedCoderClub Thank you my friend. Good channel !

  • @tejaswinimanke8119
    @tejaswinimanke8119 2 года назад

    Hi
    I am trying to plot two runtime graphs on the same chart but not found any solution can you please suggest something.

    • @RedEyedCoderClub
      @RedEyedCoderClub  2 года назад

      Hi! Did you try to use several websockets for you data flows.

    • @tejaswinimanke8119
      @tejaswinimanke8119 2 года назад

      @@RedEyedCoderClub yes..i tried that too but first graph get freez when second works..

  • @nagarjunau4188
    @nagarjunau4188 2 года назад

    Websocket is a server ? ...how to integrate with another app.py file

    • @RedEyedCoderClub
      @RedEyedCoderClub  2 года назад

      No, websocket is a web protocol, that is used to send and receive data. What do you want to achieve?

  • @ferocide4309
    @ferocide4309 2 года назад

    Somehow the JavaScript file gets loaded in the html template but doesn't get executed

  • @finalboy520
    @finalboy520 3 года назад

    how to real time display two values one chart?

    • @RedEyedCoderClub
      @RedEyedCoderClub  3 года назад +1

      The same way.
      Look here there many examples and good documentation.
      www.chartjs.org/samples/latest/

  • @igorrabelo4466
    @igorrabelo4466 2 года назад

    Hi

  • @Crisoici
    @Crisoici Год назад +1

    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

    • @RedEyedCoderClub
      @RedEyedCoderClub  Год назад

      Check you code please

    • @bisrimusthofa
      @bisrimusthofa Год назад

      similar to me, I found error "GET /ws/graph/ HTTP/1.1" 404 2259

    • @kristapsbable
      @kristapsbable Год назад +4

      @@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.

    • @sandgaara183
      @sandgaara183 Год назад

      @@kristapsbable worked for me. thanks