For anyone who isn't getting the "Starting ASGI/Channels" when starting up Django, but instead is getting the normal "Starting development server", I was able to resolve that problem by installing the *same* versions of django and channels to the virtual environment, because it looks like there was a change since this video came out. I did pip install django==3.1.4 pip install channels==3.0.2 The other dependencies didn't seem to be an issue even though they didn't match what was in the output of this video but in a few years it may be necessary to specify those as well. Great video but tutorials like this ought to specify what versions they use, for future users.
@Red Eyed Coder Club I have a question. What would make this code/example work with multiple requests? Iβm working on an app which has somewhat of a dashboard where multiple users can pick things from a list. This example works great but I was wondering what it takes for multiple users to interact
I found several tutorials for Django Channels, and they were all so convoluted I was about to give up. Thank haven I found your tutorial, it is so well laid out and easy to follow, thank you so much!!!
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!
Man, that's how tutorials should be - bare minimum to run anything, no matter how ugly it is. Literally not a single unnecessary thing. Thanks, you rock.
For those who do not run "Starting ASGI/Channels", 1) remove "channels" (pip uninstall channels) 2) pip install channels["daphne"] 3) replace "channels" in INSTALLED_APPS with "daphne", and move it to the very top of the list 4) Many thanks to Oleg for developing the skill of finding and eliminating errors
In most of django channels tutorials they are just making the chat app using django channels documentation they dont even know what they are doing what they are importing why they are importing that middleware and as a beginner it was very confusing for me but your simple and basic video was very helpul and it explained me a lot So thank you for making this video.
For everyone who wants to know the simple higher concept of Django Channels, I suggest you to watch this video first ! Then, you could continue other advanced technique with ease.
@@RedEyedCoderClub let urlPath = '{{ url }}' urlPath = urlPath.replace(/http|https/, 'ws') const socket = new WebSocket(`${urlPath}ws/example`) I think this JS websocket connection pattern more flexible, what's your opinion ? I am not an Python developer, used request.build_absolute_uri(),
@@RedEyedCoderClub, you have not so many flaws, though. There happens a slight confusion with British and American pronounciation (in some places, you read "r", despite it is implied that you will omit it in British (some kind of subtitution to a long "a"), or vice versa stretching vowels as Americans would do it) and too strong consonants (t, d, r mostly) when control over the tongue weakens a little. Thanks for the video!
first thanks that was short to the point loved it now just asking doesn't this mean its now possible to call objects from the model in just similar manner or their is additional stuff ...
Great tutorial, but I would like to understand its use-case - where do you think we could apply this logic for practically implementing it? Maybe "Chat" application? but here you are sending messages from server(django) to client(browser) using the "onmessage" method of WebSockets...and chat has to be between 2 clients(browser instances) I believe....Hence, if you could explain its practical use-case, maybe I will be able to relate it better...Anyways, thanks a lot for this tutorial.
It can be very useful to simulate a real-time processes for learning purposes (or even be programs for managing such processes itself if requirements will be easy). Imagine to write an app for students to show them how to monitor water system in the city or temperature in a steel mill, or even getting the overall state of a car during driving. In all cases sensors (consumers) emit data and there's need to display such informations (as they are or processed) on screens in a control rooms and panels.
thx a lot sir, i know the differences of concept between http and web socket but your video tells how to implement, in a very clean way! really helps for newbie like me. But sir i have a question, if i wish to push data into multiple mobile apps (developed with flutter) at the same time, how can i do that?
Thanks for the tutorial, I have a question, which address should I listen to if we talk about the server, and maybe what should I change in credentials for server work, not localhost? (in my case frontend at another server and it should listen for the websocket)
Sorry for the late answer. The websocket have to listen the IP of your server from where it gets data. The localhost is 127.0.0.1 IP address, and so there is no much difference here. But it's probably necessary to take into consideration the cross origin requests problem.
@@RedEyedCoderClub thanks for the answer, I already found out how to solve it. In settings.py I changed 127.0.0.1:8000 into 0.0.0.0:8000, and it starts work. And yeah, cross origin was too, but it wasn't big trouble)) Right now it's working, but a little bit slow(I send some requests to another server, for about 20 requests per minute), trying to find out how to make it faster
@@RedEyedCoderClub thanks for your reply I very much appreciate it, I'm a newbie in Django I like your tutorials I created a small app where anyone comes and types a keyword on the form (on the index.html page) and I created a python function that takes this keyword and scraps data from the web and returns the result to the user it returns many titles ['title1','title2','title3','title4', ......]. when I saw your real-time app I like it and I hope to display my scraped data like you do one by one don't wait for the function to scrap all titles.
This video is just a demonstration of very basic using of Django Channels. More complicated staff I put in other videos. Did you watch my other videos about using of Django Channels? They have the answer to your question. Consider of watching them, please. Than you for your comment, and have a nice day!
Hi, I have 4 videos about Django Channels. The last one is about sending requests to an API (using Celery BTW), and rendering data in real-time. The video: ua-cam.com/video/wos1uhnd3qM/v-deo.html
Listen failure: Couldn't listen on 127.0.0.1:8000: [WinError 10048] Only one usage of each socket address (protocol/network address/port) is normally permitted.
I have this error " Import "django.core.asgi" could not be resolved from source " when I write the ' django.core.asgi ' . How Δ± can solve this problem. pls help
For anyone who isn't getting the "Starting ASGI/Channels" when starting up Django, but instead is getting the normal "Starting development server", I was able to resolve that problem by installing the *same* versions of django and channels to the virtual environment, because it looks like there was a change since this video came out.
I did
pip install django==3.1.4
pip install channels==3.0.2
The other dependencies didn't seem to be an issue even though they didn't match what was in the output of this video but in a few years it may be necessary to specify those as well.
Great video but tutorials like this ought to specify what versions they use, for future users.
Thank you for making a non-chat tutorial!
Thank you for watching!
@Red Eyed Coder Club I have a question. What would make this code/example work with multiple requests? Iβm working on an app which has somewhat of a dashboard where multiple users can pick things from a list. This example works great but I was wondering what it takes for multiple users to interact
@@MrTdhillon try to follow the other Django Channels videos. It's just a very basic example.
I found several tutorials for Django Channels, and they were all so convoluted I was about to give up. Thank haven I found your tutorial, it is so well laid out and easy to follow, thank you so much!!!
Thank you very much!
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!
That was already said but it's a real pleasure to find somebody who shows only a simple websocket. Thanks !
Thank you very much!
Man, that's how tutorials should be - bare minimum to run anything, no matter how ugly it is. Literally not a single unnecessary thing. Thanks, you rock.
Thank you
Le Bootstrap: Am I a joke to you?
@@jaideepshekhar4621 Didn't get your question
@@RedEyedCoderClub It's just a joke. Good video!
For those who do not run "Starting ASGI/Channels",
1) remove "channels" (pip uninstall channels)
2) pip install channels["daphne"]
3) replace "channels" in INSTALLED_APPS with "daphne", and move it to the very top of the list
4) Many thanks to Oleg for developing the skill of finding and eliminating errors
Thanks a lot. It helps me.
Thanks a lot. I spent time in Cursor and chatGPT and still cannot get a useful solution for this.
Many thanks, kind sir.
Thanks a lot, good luck to you
You are an incredible human being, all the luck in the world to you!
ΠΠ»Π΅Π³, ΡΠΏΠ°ΡΠΈΠ±ΠΎ! ΠΡΠ΅Π³Π΄Π° ΠΊΡΡΡΠΎ ΠΈ ΠΏΠΎΠ½ΡΡΠ½ΠΎ!)
Thank you :)
In most of django channels tutorials they are just making the chat app using django channels documentation they dont even know what they are doing what they are importing why they are importing that middleware and as a beginner it was very confusing for me but your simple and basic video was very helpul and it explained me a lot So thank you for making this video.
Thank you very much!
Man. This was one of the best tutorials I ever came across. Thank you so much.
Thank you :)
This video is best for beginners. I am from Russia, but I got everything. Thanks!
Thank you very much!
Thanks a lot! I really waited this topic so much! Glad to see it right here.
Thank you!
same dude
First example out of many that's clear to me. Thank you.
Thank you for the comment!
Thanks a lot for explaining so clearly the basics of django channels and web sockets.
Thank you!
Really necessary minimum for understanding Django channels basics.
Thank you! Glad that it was helpful. Have a nice day!
Awesome stuff. It's so rare to find tutorials about Django Channels.
Thank you very much!
yes, we need the spark and you just gave it. Awesome video.
Thank you very much!
Your voice is like watching django channels on discovery channel
Thanks for the tutorial
Thank you!
Very useful tutorial. A lot of thanks.
This answered many questions i have. Thanks Red!
Thanks for watching!
yeah boiii, finally some minimal real time app
Thank you very much!
Fantastic work!!! very simple and easy to follow. Thank you so much.
Thanks for watching!
such a great tutorial! well thought approach for leaners new to channels concept!
Thank you very much!
thank you for this tutorial! It was very helpful to understand the basics of channels.
Thank you!
For everyone who wants to know the simple higher concept of Django Channels, I suggest you to watch this video first ! Then, you could continue other advanced technique with ease.
Thank you
Man the best tutorial that I find in youtube! Do you have a git rep link of this project?
Thanks!
Really a was needed this thank you man
Thank you for your comment.
Thank you very much for Great example broπ.
Thank you! :)
simple and complete .. love u ..
Thank you!
That is simple and undestandble. You are amazing teacher. Thank you so much.
Thank you!
Hello, nice video, do you use Redis? Is it necessary? thanks
Thank you for the detailed info!
Thanks for watching!
Thank you very much, simple and understandable, I like yours 'Π²ΠΈΠ·Π³ΠΈ' and 'Π°ΡΠ³ΠΈ' )
Thanks. I guess it's the right pronunciation according to the en.wikipedia.org/wiki/Web_Server_Gateway_Interface
@@RedEyedCoderClub let urlPath = '{{ url }}'
urlPath = urlPath.replace(/http|https/, 'ws')
const socket = new WebSocket(`${urlPath}ws/example`)
I think this JS websocket connection pattern more flexible, what's your opinion ? I am not an Python developer, used request.build_absolute_uri(),
yep, you are right
Π£Π΄ΠΈΠ²ΠΈΡΠ΅Π»ΡΠ½ΠΎ, Ρ Π°Π½Π³Π»ΠΈΠΉΡΠΊΠΈΠΉ ΡΠ°ΠΊ ΡΡΠΊ Π·Π½Π°Ρ, Π½ΠΎ ΡΠ΅Π±Ρ ΠΏΠΎΡΠ΅ΠΌΡ-ΡΠΎ ΠΏΠΎΠ½ΠΈΠΌΠ°Ρ...)))) Π‘ΠΏΠ°ΡΠΈΠ±ΠΎ Π·Π° ΡΠΎΠ»ΠΈΠΊ!!!
Because of my pronunciation :)
@@RedEyedCoderClub, you have not so many flaws, though. There happens a slight confusion with British and American pronounciation (in some places, you read "r", despite it is implied that you will omit it in British (some kind of subtitution to a long "a"), or vice versa stretching vowels as Americans would do it) and too strong consonants (t, d, r mostly) when control over the tongue weakens a little.
Thanks for the video!
@@veirant5004 Thank you very much! I will work on it :)
Thank you a lot. I really wanted this!!
Thanks for watching! Have a nice day
Great video, Thanks a lot. π
Thanks for watching!
Thank you, I used it for a real time trading app π
Thanks for watching and for your comment!
first thanks that was short to the point loved it now just asking doesn't this mean its now possible to call objects from the model in just similar manner or their is additional stuff ...
Not sure that got you correctly. Did you watch my other Django Channels videos?
Thank you
Thanks for watching!
man you nailed it
Thank you!
Great tutorial, but I would like to understand its use-case - where do you think we could apply this logic for practically implementing it? Maybe "Chat" application? but here you are sending messages from server(django) to client(browser) using the "onmessage" method of WebSockets...and chat has to be between 2 clients(browser instances) I believe....Hence, if you could explain its practical use-case, maybe I will be able to relate it better...Anyways, thanks a lot for this tutorial.
This example has no practical use case. It's just an example of how to use Django Channels. Nothing more. I'll make more useful videos a bit later.
It can be very useful to simulate a real-time processes for learning purposes (or even be programs for managing such processes itself if requirements will be easy). Imagine to write an app for students to show them how to monitor water system in the city or temperature in a steel mill, or even getting the overall state of a car during driving. In all cases sensors (consumers) emit data and there's need to display such informations (as they are or processed) on screens in a control rooms and panels.
thx a lot sir, i know the differences of concept between http and web socket but your video tells how to implement, in a very clean way! really helps for newbie like me. But sir i have a question, if i wish to push data into multiple mobile apps (developed with flutter) at the same time, how can i do that?
Try to watch next video about broadcasting. It has the answer on you question.
Thanks for the tutorial, I have a question, which address should I listen to if we talk about the server, and maybe what should I change in credentials for server work, not localhost? (in my case frontend at another server and it should listen for the websocket)
Sorry for the late answer. The websocket have to listen the IP of your server from where it gets data. The localhost is 127.0.0.1 IP address, and so there is no much difference here. But it's probably necessary to take into consideration the cross origin requests problem.
@@RedEyedCoderClub thanks for the answer, I already found out how to solve it. In settings.py I changed 127.0.0.1:8000 into 0.0.0.0:8000, and it starts work. And yeah, cross origin was too, but it wasn't big trouble)) Right now it's working, but a little bit slow(I send some requests to another server, for about 20 requests per minute), trying to find out how to make it faster
Nice video, thanks
Thanks for watching!
Do you know about rooms in SocketIO? Is there an equivalent to that in Channels?
I know about rooms. Did you watch my other Channels videos?
Very cool. Will you make it in the future to support multiple clients?
The next video in the series with a project, that supports multiple clients.
@@RedEyedCoderClub Hey, looking forward to it! Thanks for replying. Have a nice day!
Thank you!
Great video, Thanks a lot ^_^
Thank you!
Thanks for this Amazing tut please how we can send data from view to consumer
Thank you. Didn't get what you want to achieve. Can you elaborate it a bit?
@@RedEyedCoderClub thanks for your reply I very much appreciate it,
I'm a newbie in Django I like your tutorials
I created a small app where anyone comes and types a keyword on the form (on the index.html page) and I created a python function that takes this keyword and scraps data from the web and returns the result to the user it returns many titles ['title1','title2','title3','title4', ......].
when I saw your real-time app I like it and I hope to display my scraped data like you do one by one don't wait for the function to scrap all titles.
This video is just a demonstration of very basic using of Django Channels. More complicated staff I put in other videos.
Did you watch my other videos about using of Django Channels?
They have the answer to your question. Consider of watching them, please.
Than you for your comment, and have a nice day!
Wow, realy easy and tiny. π
Thank you!
Amazing , tks a lot!
Thanks for watching and have a nice day!
Itβs a great tutorial.
Could you upload the demo code to the githubοΌ
Thank you a lot.
The project has the minimum of Python and JS code.
6:10 video starts
Thanks for comment
Can python be used as a client?
Actually no, but Python code can be compiled to JS, and this allows to use Python on frontent.
works great, but when I close the window and then reopen the same window, page doesn't work. I think I need another function when is disconnect
It's just the most minimal example. Did you try another videos of the series?
1000th likeπ
Thank you :)
Hi, can we scrape data and display data scrapped in real-time in place of your random numbers?
Hi, I have 4 videos about Django Channels.
The last one is about sending requests to an API (using Celery BTW), and rendering data in real-time.
The video:
ua-cam.com/video/wos1uhnd3qM/v-deo.html
@@RedEyedCoderClub thanks, This is why you are the best
Thank you!
very useful, tank you
Thank you!
What if I refresh the page, there is no disconnect method in the consumer. Can you help me to understand what can I write in disconnect method.
In disconnect method usually is the logic of quitting from a group/channel and regarding stuff.
Nice!
Thank you
Can anybody tell me why we do need to use json here? Like for what purposes we use that?
JSON is convenient data format. That's why.
Thank you!
Thanks for watching!
Can asgi and wsgi run at the sametine ?
Yes, it's possible.
what if we refresh the page?? the connection is going to fail or it will reconnect??
It should reconnect but it won't, because it's a very basic example. Consider of watching my other Django Channels video.
Its great, but how to close the connection ?
Try to call the self.close() method in the connect method
Listen failure: Couldn't listen on 127.0.0.1:8000: [WinError 10048] Only one usage of each socket address (protocol/network address/port) is normally permitted.
Check your code, please
I have this error " Import "django.core.asgi" could not be resolved from source " when I write the ' django.core.asgi ' . How Δ± can solve this problem. pls help
What are you doing? What do you want to achieve?
Why can't you load the site in another tab? It's blocking any new requests?
It just can't handle the second request, because it's fully synchronous app.
Bro you just took the job of the Usestates in React..
How do I pass that data to the live html?
It will work the same way in production
please anyone
ERROR is
django.core.exceptions.ImproperlyConfigured: Cannot import ASGI_APPLICATION module 'startup.asgi'
check your code or start a new project from scratch. I've got the same bug one time.
How can we use the same on server, its not connecting
This example is not for production, consider watching of my other Django Channels videos.
Thanks for comment
and for deploy this project?
Maybe next time
why do you use redis?
Why not to use Redis?
Ok but can you make a scalable video chatting app with this
I'll make a video about chatting app, but it'll be a bit later. It'll be the video #5 in the Channels topic.
thank you so much
Thank you too!
Thank you sir
Thank you too!
jared yambao gusto mag lig pero wala pang comment
Π‘ΠΏΠ°ΡΠΈΠ±ΠΎ Π·Π° ΡΠΎΠ»ΠΈΠΊ! Π£ ΠΌΠ΅Π½Ρ Π°Π½Π³Π»ΠΈΠΉΡΠΊΠΈ Π½Π΅ Π½Π° ΡΡΠΎΠ²Π½Π΅, Π½ΠΎ Ρ Π²ΡΠ΅ ΠΏΠΎΠ½ΡΠ»
its not working with https
:D It's just an example, demonstrating the basic principle.
@@RedEyedCoderClub ok. how to remove client limitations?
Please make Django chat app
Of course, but a bit later
@@RedEyedCoderClub by the way your content is amazing keep it up!!!
Thank you!
ΠΠΎΠ³Π΄Π° Π±ΡΠ΄ΡΡ Π²ΠΈΠ΄ΠΎΡΡ Π½Π° ΡΡΡΡΠΊΠΎΠΌ?
Maybe later
ΡΠΏΠ°ΡΠΈΠ±ΠΎ Π±ΠΎΠ»ΡΡΠΎΠ΅
You're welcome
thanx
Are you russian person?
Π― Π½Π΅ Π·Π½Π°Ρ ΠΌΠΎΠΆΠ½ΠΎ Π»ΠΈ ΡΠ°Π·ΠΌΠ΅ΡΠ°ΡΡ ΡΡΡΠ»ΠΊΠΈ Π½Π° ΠΊΠ°Π½Π°Π» Π² ΠΊΠΎΠΌΠΌΠ΅Π½ΡΠ°ΡΠΈΡΡ . ΠΏΠΎΡΡΠΎΠΌΡ ΠΏΡΠΎΡΡΠΎ ΠΏΠΎΡΠΎΠ²Π΅ΡΡΡ Π½Π°Π±ΡΠ°ΡΡ ΠΠ»Π΅Π³ ΠΠΎΠ»ΡΠ°Π½ΠΎΠ² Π² ΠΏΠΎΠΈΡΠΊΠ΅ ΠΈ Π½Π°ΠΉΠ΄Π΅ΡΡ Π΅Π³ΠΎ ΡΡΡΡΠΊΠΎΡΠ·ΡΡΠ½ΡΠΉ ΠΊΠ°Π½Π°Π»
@@ΠΡΡΠ»Π°Π½ΠΠ°ΠΉΠ±Π°ΡΡΡΠΎΠ²-Ρ5ΠΌ Π΄Π° Π»Π°Π΄Π½ΠΎ ΡΡΠΎ ΠΎΠ½? XDDDDD
yep, it's him
o please anyone help
try to check your code
thank you very much
Thanks for watching, and for the comment!