Learn Django - Build an Asynchronous Chatroom with Django and Channels

In this Django tutorial we learn the theory behind WebSocket's, ASGI, and Channels and then go on to build a chatroom to demonstrate how to use and build asynchronous applications.
Windows Users:
==================
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools
Download:
1.visualstudio.microsoft.com/do... (at bottom select Build Tools for Visual Studio 2019)
3.Run and install build tools
00:00 Introduction
01:24 Project specifications
02:35 Synchronous Vs Asynchronous
07:35 WebSockets
14:56 Channels
18:52 Start developing - create virtual environment & install Django
20:31 Install Channels
33:58 Routing
39:37 Consumer
44:09 Consumer - connect
51:43 Consumer - disconnect
55:57 Front-end
1:05:57 Remember accept is needed to allow WS connections
1:09:20 Channel layer configuration (Redis optional)
1:12:09 Finishing the chatroom
Code Repository:
github.com/veryacademy/YT-Dja...
Codebase and further reading:
channels.readthedocs.io/en/la...
SUBSCRIBE to get more free tutorials, courses and code snippets!
/ @veryacademy
Follow us on Facebook
/ veryacademycom-1132321...
Follow use on Twitter:
/ veryacademy

Пікірлер: 275

  • @marc2933
    @marc29332 жыл бұрын

    This tutorial is by far THE BEST Django Channels tutorial I have encountered. This provides the greatest step by step direction and clarity. Thank you!

  • @veryacademy

    @veryacademy

    2 жыл бұрын

    Thanks Marc, hopefully this is just the beginning. Just need to get this channel making a little more and I will just make tutorials 24/7. There is so much more quality I can add to these tutorials - great to hear you think its the best!

  • @runner-learner2755
    @runner-learner27552 жыл бұрын

    Thank you so much for this amazing lecture! I loved your explanation about project specifications and concepts.

  • @stellaofthelake3451
    @stellaofthelake34512 жыл бұрын

    I really felt that I've learned and accomplished something at the end of the video, thank you!!!

  • @Yahookudi
    @Yahookudi3 жыл бұрын

    This is really brilliant work that you're doing. Thank you!

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    Glad you enjoy it! Thank you! 👍

  • @shashikantsingh840
    @shashikantsingh8403 жыл бұрын

    Big thanks to this channel for making such beautiful content, After watching this video documentation is so easy to understand.

  • @maimunarahman7837
    @maimunarahman78372 жыл бұрын

    that was really helpful for me . you are serving such a brilliant service to us Thanks a lot

  • @janirico5641
    @janirico56413 жыл бұрын

    another excellent Django tutorial, and you so appreciated by the Django Community......

  • @quocbao6046
    @quocbao60463 жыл бұрын

    Ok, I have looking for a source to learn about Django Websocket for the whole week and this video truly saved my ass. Any other videos altho may has more views but just kinda rush into the tutorial without explaining anything. This video is super informative and great explaination. Your channel is a gem. Thank you so much. Keep up the great work.

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    Thank you 👍

  • @arvindshelke8889
    @arvindshelke88892 жыл бұрын

    Efforts appreciated! man ur just terrific. i cant thank you enough how easy u made me to understand.

  • @ammu_00_7
    @ammu_00_73 жыл бұрын

    This is gold. The best tutorial. Keep em coming

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    Thanks, will do!

  • @VanessaCarvalhoLima
    @VanessaCarvalhoLimaАй бұрын

    Thank you for the tutorial!! Helped a lot

  • @yashm05
    @yashm05 Жыл бұрын

    Explained very beautifully, Thank you 🙏

  • @ShubhamSingh-lu1gy
    @ShubhamSingh-lu1gy3 жыл бұрын

    You, sir, are a great teacher! Thank you :D

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    You're very welcome! 👍

  • @sheldondsouza8979
    @sheldondsouza89793 жыл бұрын

    really amazing, I would like to see more tutorials tq so much it just works fine

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    I will be swinging back to this soon and updating it with a full on system (I say soon - maybe 8 weeks or so) 👍

  • @swapnilsharma5974
    @swapnilsharma59743 жыл бұрын

    Hey! This is amazing! Thank you so much! Could you please advise in what order should a beginner watch all your playlists to gain complete knowledge and become proficient in Django? Just a piece of advice you can make a short video of this or mention it in any of your upcoming videos. Lastly, thanks again for creating these videos and making them available to global users for free.

  • @aashayamballi
    @aashayamballi3 жыл бұрын

    Yay! Channels takes django to next level. Thank you so much for this. Could you please show us how to deploy this as well.. Because I've not seen any good content on deploying channels to a production grade server. If you're making any series on this that would be a great content. Loving all your Django content. Keep up the good work. And again, thank you so much 🙏🏼

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    I will do an initial deploy to Heroku up next so that folks can get a look at using Redis. Do you have any deployment preferences?

  • @aashayamballi

    @aashayamballi

    3 жыл бұрын

    @@veryacademy Nginx with uvicorn/daphne would be great. Thanks 😊

  • @aashayamballi

    @aashayamballi

    3 жыл бұрын

    @@veryacademy if we're having a series on django channels another idea for this series would be, processing a huge file in background using Celery and giving real time updates in a progress bar or something. Since channel has an option to subscribe to a particular group and send updates using channel layers.

  • @KrishnaManohar8021

    @KrishnaManohar8021

    3 жыл бұрын

    @@veryacademy Yaaaa🔥🔥🔥🔥

  • @fantasmoclone2778
    @fantasmoclone27783 жыл бұрын

    Great video man! Really helped me. Thanks a lot

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    Glad it helped! Hopefully will get around to updating this with more features sooner than later

  • @abhiverma24
    @abhiverma243 жыл бұрын

    I was looking for this..thank you 😁

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    No problem 😊

  • @aysershuhaib478
    @aysershuhaib4783 жыл бұрын

    Great work for a boilerplate, THANK YOU.

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    Our pleasure!

  • @tanvir-lab
    @tanvir-lab3 жыл бұрын

    Such a great tutorial. Thank you so much

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    You are so welcome!

  • @anthonychianain2241
    @anthonychianain2241 Жыл бұрын

    Thank you so much!! You are the best Django teacher... Gaining alot from you

  • @veryacademy

    @veryacademy

    Жыл бұрын

    Happy to hear that!

  • @Algeriaiptv
    @Algeriaiptv2 жыл бұрын

    Amazing thank you very much and keep going

  • @maahad767
    @maahad7673 жыл бұрын

    Amazing tutorial.

  • @davisantosr214
    @davisantosr2143 жыл бұрын

    really awesome tut. Thank u

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    You're welcome!

  • @thobiaslarsen8336
    @thobiaslarsen83362 жыл бұрын

    duuude you are on your way to save me in my current project at school! We are doing this way too advanced project, and this is just what I needed

  • @veryacademy

    @veryacademy

    2 жыл бұрын

    If your doing this at school - you have a great teacher. Most teachers can’t even work PowerPoint

  • @thobiaslarsen8336

    @thobiaslarsen8336

    2 жыл бұрын

    @@veryacademy We have a subject called Digital Design and Development, where we are creating websites. Though I have never used Django before, I have programmed for a long time. Yeah Denmark has really nice subjects, but I cannot get the part of printing hello world on the website to work. Must be a mistake somewhere. I must take a look when I return to two screens instead of one.

  • @thobiaslarsen8336

    @thobiaslarsen8336

    2 жыл бұрын

    @@veryacademy Oh, and I basicly learn all this myself, since it has never been a requirement for the subject, I just found it interesting and useful

  • @lokifrazzer8137
    @lokifrazzer81373 жыл бұрын

    thank you so much. Really useful

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    Glad it was helpful!

  • @adityakotikalapudi329
    @adityakotikalapudi3293 жыл бұрын

    Very nice tutorial 🙏 thanks please do more videos to help us

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    More to come!

  • @taihatranduc8613
    @taihatranduc86132 жыл бұрын

    thank you. you are amazing

  • @learndjango6423
    @learndjango64233 жыл бұрын

    Thank you sir...this is what I needed 😊 please also teach us how to deploy this - many thanks 👍

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    Recording it right this second!

  • @neelrai3426
    @neelrai34263 жыл бұрын

    respect from heart for you man

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    You are more than welcome

  • @meetgor
    @meetgor3 жыл бұрын

    Brilliant absolutely Brilliant 👍

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    👍

  • @helloworld2740
    @helloworld27402 жыл бұрын

    really awesome course sir

  • @victordziedzorm
    @victordziedzorm3 жыл бұрын

    You just gained a sub!

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    👍

  • @za_daleko
    @za_daleko3 жыл бұрын

    Thank you for this

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    You're so welcome!

  • @KrishnaManohar8021
    @KrishnaManohar80213 жыл бұрын

    Mind-blowing 👌

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    Very powerful statement there Manu, its ok - I really don't enjoy listening back - but I hope that there is something to learn here. Like Aashay suggests - this is Django next level - but translated - a little bit more interesting and fun 😂

  • @MrLOPIU22
    @MrLOPIU22 Жыл бұрын

    THANK YOOOOU SOOO MUUUUUCH

  • @artsytechie2053
    @artsytechie20532 жыл бұрын

    really cool, thank you. What would one use to create a private messaging app in django though? like being able to add a friend and chat to them 1 on 1?

  • @takibahmed8859
    @takibahmed88592 жыл бұрын

    Thank you sir

  • @Fanceh
    @Fanceh3 жыл бұрын

    Dude you deserve million subs!!

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    That seems like a long way off at the moment, but hopefully one day!

  • @Fanceh

    @Fanceh

    3 жыл бұрын

    @@veryacademy haha for sure homie. A quick suggestion though: It would really help alot if you could make a React beginner series

  • @osmanio
    @osmanio3 жыл бұрын

    A very good tutorial. Thank you very much. Is there another video to save the data in the database? Your last videos unfortunately continue with other topics. Furthermore it would be interesting to know how to restrict the chatroom for example for 2 users (private chat).

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    Hi Osmanio - really sorry I stopped this run of tutorials, at least for now - the community members were asking for more DRF that is why I concentrated all my efforts on that. I do want to come back to this and do exactly that and expand on this more to make it a little more feature rich.

  • @xlsautomatizaciones9197
    @xlsautomatizaciones91973 жыл бұрын

    This is a very high quality content. Congratulations!! BTW Whats the best way to receive messages from a mqtt broker using django channels?

  • @hadytaha2344
    @hadytaha23443 жыл бұрын

    Thank Thank Thank Thank Thank Thank Thank Thank Thank Thank Thank you 💖💖💖💖💖💖💖💖

  • @RajatSharma-er7ni
    @RajatSharma-er7ni2 ай бұрын

    Every time I see it for building the project, I fell asleep in just a few minutes. Is it only me or its his voice that make me feel sleepy.

  • @janirico5641
    @janirico56413 жыл бұрын

    can we also a Direct Message tutorial? its would complete the series. many thanks for your great efforts and work

  • @andyjessica8734
    @andyjessica87342 жыл бұрын

    Thank you so much for this... I'm still running into this "cannot import ASGI_APPLICATION module..." Error though, what can I do?

  • @fugentech1410
    @fugentech14103 жыл бұрын

    Sir, can you make a full-video on django channels like saving messages or something like that.

  • @paborlouise319
    @paborlouise3193 жыл бұрын

    Great series to learn async views in Django. Thanks alot.

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    Hey Pabor, yeah it is a little more exciting using async and does open lots of great potential for learning more exciting apps

  • @creepermanpro
    @creepermanpro3 жыл бұрын

    your voice sounds like the net ninja.

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    Thanks Jack 😂 I guess that cant be a bad thing 👍

  • @absoluteunit4357
    @absoluteunit43575 ай бұрын

    To save someone else the trouble make sure to use channels version 3.0.5

  • @mordecaisalinas5799
    @mordecaisalinas57992 жыл бұрын

    This is a great tutorial video. I just have a couple of issues. Every time I type in from channels.auth import AuthMiddlewareStack it gets highlighted yellow and it says that import packages is missing. What can I do to resolve the issue?

  • @createlifejr
    @createlifejr3 жыл бұрын

    Thank you for the tutorial.. Is it possible to replace Ajax requests with websockets? If so will it be efficient? Thanks

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    Hi Createlyf, it is possible to use AJAX in this scenario but as you suggest, you would most probably need to periodically send AJAX requests in order to create a functional real-time chat application. Once you start scaling this type of approach you are sending a lot of requests to the server - there are other and better approaches that you could use.

  • @mc200520052005
    @mc2005200520053 жыл бұрын

    Thank you for the tutorial. What is the best approach to integrate a database in chat application giving the fact that database is syncron app and chat channels asyncron? Syncron channels with db or asyncron channels with syncron-to-asyncron connection db? Thank you.

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    Hi Mihai, sorry for the delay - I was thinking about this one in bed last night. When you say the best way. Could you give me some examples of different approaches you were thinking of?

  • @coderslav4505
    @coderslav45052 жыл бұрын

    Don't forget about ChatRoomConsumer.as_asgi() in websocket_urlpatterns if you have problem like: TypeError: __call__() missing 1 required positional argument: 'send' GL!

  • @veryacademy

    @veryacademy

    2 жыл бұрын

    👍

  • @coderslav4505

    @coderslav4505

    2 жыл бұрын

    @@veryacademy Thank you for the amazing guide. Very detailed! You have helped me a lot!

  • @mrbuslov

    @mrbuslov

    2 жыл бұрын

    You really helped me, thanks!

  • @shubh4319
    @shubh43193 жыл бұрын

    please add requirements.txt that has the package versions, That's a lot of debugging if we don't have similar packages which was used in this project will provide a lot of help

  • @SurinamElephant
    @SurinamElephant3 жыл бұрын

    Hi, great tutorial! Question: Why do i have to / what's the benefit of including my own app ("chat" in this case) to installed apps ? I thought the settings would list all apps that are installed into my own app ? I haven't listed my own app so far and haven't noticed any difficulties so im wondering what it does

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    Hi Surinam, if you are referring to INSTALLED_APPS in settings. By adding your app to the list allows your app and Django to interact with each other in certain situations. For example working and interacting with databases. Here is the manual reference docs.djangoproject.com/en/3.0/ref/applications/ Any other questions please just ask.

  • @SurinamElephant

    @SurinamElephant

    3 жыл бұрын

    @@veryacademy Yeah, i did that sooo much earlier in my project that i forgot that i added it haha

  • @M-ABDULLAH-AZIZ
    @M-ABDULLAH-AZIZ Жыл бұрын

    is this more scalable and less costly when deploying than using firebase realtime db with a mobile chat app?

  • @muthupandynagendran
    @muthupandynagendran3 жыл бұрын

    hi sir ,you saved my time best video about channels, thanks lot, i have some doubts 1.this chat application we can put our existing project ? 2.any difference in while deployment time? 3. i am previously using redis on windos 10 but not working then i used channels.layers.InMemoryChannelLayer 4 in production we use inmemorychannel layer

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    Hello, 1 - yes indeed you can put it into an existing project - sorry I cant really be anymore specific here. 2 - Yes I think I did make a tutorial where we deployed it - this is just a really basic example - I will revisit this series once we have established more DRF tutorials. 3 - Yes memoryChannelLayer setting is not for Redis - you need to change that setting to work with your Redis application on Windows (You are very brave using Redis on Windows 👍) 4 - In-memory channel layers operate each process as a separate layer, which means no cross-process messaging is possible. As the core value of channel layers to provide distributed messaging, in-memory usage will result in sub-optimal performance and data-loss in a multi-instance environment.

  • @mohamedsoliman5082
    @mohamedsoliman50823 жыл бұрын

    Thank you for your awesome? tutorials is this ready to deploy to production

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    Not at all unfortunately

  • @mrsreekanth240
    @mrsreekanth240 Жыл бұрын

    is there anyway to implement 1 to 1 chat in django without the chat room?

  • @joshstrawder
    @joshstrawder3 жыл бұрын

    Just a couple of questions, how would I add a second chat room? And, let’s say I wanted the user to be able to change chat rooms by typing something like “change room + room name”. How what that be done? Essentially, how do you make the app react to certain kinds of input? I’m decently familiar with Python but I’m still new to Django. Thanks!

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    Hi Josh, good questions - but it needs to be replied with a tutorial. I will get rid of this one and - as there is a lot of requests for this type of feature will build it all

  • @Sakupa2
    @Sakupa26 ай бұрын

    so i have a question, When we are using websocket and Channels we don't store data in the database using Models? and is it that we have to use consumer, routing and the template always?

  • @sandhyashirsath
    @sandhyashirsath3 жыл бұрын

    What's the front-end and Back-end of this project

  • @baetraki7268
    @baetraki72682 жыл бұрын

    can you make this with WebSockets & DRF

  • @mytube5182
    @mytube51823 жыл бұрын

    Tq

  • @technojalvi4122
    @technojalvi41223 жыл бұрын

    Will it work im using mySQL database

  • @user-fd8zs2zw6p
    @user-fd8zs2zw6p4 ай бұрын

    Mm, of course nice video

  • @gamingzonebk5943
    @gamingzonebk59433 жыл бұрын

    Hello, I am having a long error lines while I tried to install channels with pip when It comes to install twisted , occuring an error please anybody can help me with that?

  • @jhkz4313
    @jhkz43133 жыл бұрын

    is there any ways to send a user avatar through the websocket or is there any other ways to show not only username but also user avatar that you built in your videos. I think it can send avatar url as the way to send username in this video. I don't know how it would work in production.. Thanks always appreciate your effort!

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    stackoverflow.com/questions/41492493/django-channels-file-image-upload

  • @wanderingtravellerAB99
    @wanderingtravellerAB993 жыл бұрын

    ​ @Very Academy Hi there, love your content. I wonder if you have any suggestion how I might integrate voice reecording when the chatroom is deployed on mobile. My scenario is a market research app where a chatroom will purely be between one user and the server, and i want to give the user the option of pressing "record", recording a voice memo, and having that upload to the server. Tips very much appreciated!

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    Best I can suggest here. Assuming you mean webapp viewed on a mobile. Django supports a file field. I would imaging some JavaScript capturing audio and passing over to django saving in a filefield in the db. docs.djangoproject.com/en/3.1/ref/models/fields/ github.com/collab-project/videojs-record 👍

  • @wanderingtravellerAB99

    @wanderingtravellerAB99

    3 жыл бұрын

    @@veryacademy Hi, yes, you're right, it will be a standard webpage, but viewed on mobile, obviously with appropriate responsiveness. Thanks so much for your reply, I'm going to check that out.

  • @infoguru748
    @infoguru7483 жыл бұрын

    I wanted to know very much is building a platform like WeChat possible,like WeChat with all it's features.and can there pls,pls be a tutorial for it pls i would be grateful

  • @shahbozsharafzoda7441
    @shahbozsharafzoda7441 Жыл бұрын

    can anyone share the exact code for base.html which is used here.

  • @middleverse3838
    @middleverse38383 жыл бұрын

    Learned a lot. Feedback: Wish there was a bit more clearer explanation about how the routing is taking place, how the consumers is being talked to and is talking with. Code wise it was great, but I got lost plenty and had to look up the docs for an "overview" of the concepts. First time building a Django app and I could see prerequisite Django knowledge would be beneficial for this project.

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    Music to my ears - if you got lost and looked it up that means I have done what I set out to do 👍

  • @middleverse3838

    @middleverse3838

    3 жыл бұрын

    @@veryacademy haha touché

  • @middleverse3838

    @middleverse3838

    3 жыл бұрын

    @@veryacademy I'm having an issue. around the 1:11:00 mark, we we add the chatroom view's html, and javascript for opening up a websocket. I'm getting a handshake failure and 500 error. THe docs says that should happen due to not having a consumer, but in this tutorial we had already built the consumer. So i'm not sure why the error is happening. Pls help.

  • @middleverse3838

    @middleverse3838

    3 жыл бұрын

    btw the error is: TypeError: object.__init__() takes no parameters, from websocket.py. I've spent a few hours to fix this, not sure of the issue.

  • @middleverse3838

    @middleverse3838

    3 жыл бұрын

    @@veryacademy 2 hours later, figured it out. To anyone having this same error: I forgot to append ".as_asgi()" to "consumers.ChatRoomConsumer", so it should have been "consumers.chatRoomConsumer.as_asgi()" In your code given above, as_asgi() was missing from your code in this context. So not sure how it worked, or if you added behind the scenes, please confirm with me.

  • @user-gp6mi3yn6g
    @user-gp6mi3yn6g11 ай бұрын

    can i combine this backend to a swift frontend ? (for ios development)

  • @veryacademy

    @veryacademy

    11 ай бұрын

    Yes 👍

  • @pranjalpatidar982
    @pranjalpatidar9822 жыл бұрын

    anyone plz help me to resolve this error - raise ImproperlyConfigured("Cannot import ASGI_APPLICATION module %r" % path) django.core.exceptions.ImproperlyConfigured: Cannot import ASGI_APPLICATION module 'healthscape.routing'

  • @stellaofthelake3451
    @stellaofthelake34512 жыл бұрын

    28:30 ran into so many errors with the tutorial and trying to get it fixed as I code it's definitely frustrating!!!

  • @ritikmittal2660
    @ritikmittal26603 жыл бұрын

    before starting are you also doing the markup and css styling in the project? please answer anyone

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    It is just a showcase for Django rather than actually doing styling etc - so I think the answer is no

  • @ritikmittal2660

    @ritikmittal2660

    3 жыл бұрын

    @@veryacademy i have to make the project for my college so i can refer for django part to this video and style my project on my own. is that correct?

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    Yep, that’s right

  • @ritikmittal2660

    @ritikmittal2660

    3 жыл бұрын

    @@veryacademy okay thanks a lot.

  • @kiransalve403
    @kiransalve4033 жыл бұрын

    please make projects on Shipping management system in django

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    Thats a good idea - thank you

  • @mickeajax
    @mickeajax2 жыл бұрын

    Great tutorial! I get an error message ImproperlyConfigured: Cannot import ASGI_APPLICATION module ‘chat.routing’ I’ve been searching for solutions every where but I can’t find any that’ll fix it. Do you have any solutions for it? Thanks! 🙏🏻❤️

  • @The.Anime.Library

    @The.Anime.Library

    Жыл бұрын

    did you find any solutions for it ? i have the same problem

  • @navinross3357
    @navinross3357 Жыл бұрын

    hello can i still use this guide because i saw some changes in the documents of channels like " python -m pip install -U 'channels[daphne]' "

  • @veryacademy

    @veryacademy

    Жыл бұрын

    It should be ok as a starter. Just make sure you use the identical versions of the packages in the tutorial. If you follow the tutorial, maybe first, then update the code based on newer framework versions.

  • @aryanrathee5098

    @aryanrathee5098

    5 ай бұрын

    hii did ur code work? I am getting an error Not Found: /ws/chat/aaaa/

  • @user___01
    @user___012 жыл бұрын

    anyone knows how to retrieve old messages?

  • @fun8643
    @fun8643 Жыл бұрын

    Great work. could we also include "The video chat option"

  • @veryacademy

    @veryacademy

    Жыл бұрын

    This tutorial has been one of the most popular on the channel. I am making 2-3 more courses and then will be building a whole course on this topic.

  • @fun8643

    @fun8643

    Жыл бұрын

    @@veryacademy Will surely follow it

  • @emersonzapata1611
    @emersonzapata1611 Жыл бұрын

    I thought this could be a good project to be done, but know I'm doing something more complex, so I would really like to have a complete course using consumers, routing, channels and that stuffs maybe if someone has something like that I would really aprecciate the help

  • @veryacademy

    @veryacademy

    Жыл бұрын

    Keep an eye on the channel, I have been busy the past 4 weeks building and recording this project. ETA is 2-3 weeks.

  • @StayWithTAREK
    @StayWithTAREK2 жыл бұрын

    raise KeyError(key) from None KeyError: 'REDIS_URL' got this error.

  • @rayzecor
    @rayzecor3 жыл бұрын

    After the explanation I am not sure I understand exactly why we are using asynchronous code as opposed to synchronous. Does it make a difference in a chat app?

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    Hi Layers. Synchronous - send data in one direction at a time. We send data (we wait for reply) we do nothing else until we get a reply. Asynchronous - send data and retrieve data at same time. We send data and do some other things then we might get a reply at some point. The point is here in chat. Imagine we both go to the chat room. I add a message and press send. You are not going to get that message until you refresh the page - when you refresh the page you send a message to the server asking for any latest messages - the server gives you the data. So - until you refresh you are not going to get my message. Working asynchronously - when you go into the chatroom now your browser is always waiting for data (new messages) and will show you then automatically - so now when I type a message and send you get it instantly.

  • @rayzecor

    @rayzecor

    3 жыл бұрын

    @@veryacademy isn't that what the websocket does? Async code just runs on different threads so it doesn't hold up the queue, allowing for multiple actions. I've seen several examples of chat rooms with channels 3 that did not use async code.

  • @rayzecor

    @rayzecor

    3 жыл бұрын

    channels.readthedocs.io/en/latest/tutorial/part_2.html In this tutorial on the official Django documentation page they are using a synchronous consumer to achieve the same thing.

  • @jonaswinnewisser1900
    @jonaswinnewisser19003 жыл бұрын

    I did everything step by step. However, the http does not get upgraded to a websocket. How could this be explained? Looking forward to any help :)

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    Hi Jonas, hey this can be a real pain if you don't get everything lined up. Have you tried the code I provided or are you just building your own?

  • @aryanrathee5098

    @aryanrathee5098

    5 ай бұрын

    any updates? I am having the same error

  • @aryanrathee5098

    @aryanrathee5098

    5 ай бұрын

    @@veryacademy I tried building on my own but got same error

  • @hansalexander1051
    @hansalexander10513 жыл бұрын

    Will there be other tutorials about Django Channels again?

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    Yes definitely, we have barely started it. I originally said I would wait for Django 4 which will give us more tools for this type of work. I will put together and run a project beforehand if you like. Can you give me any inspiration? Shall I continue chat or do something else?

  • @hansalexander1051

    @hansalexander1051

    3 жыл бұрын

    @@veryacademy Django 4 is still far away... I recommend you to create Playlists based on Project or App using Django stack. Django stack here means : Django + DRF + React + Redux + Django Channels + Redis + Postgres + Heroku + anything necessary depends on the project or app that you gonna build and share to others in this awesome channel. I've seen lot of React + Firebase to create app clones, but still rare that use Django stack for real time app. Especially combined with Front End Framework like react. I love Django, and I believe Django + React is something beyond any web stack, in the future (it's the best combination I think). I've watched some of your videos in this channel, the topics are very interesting, since I'm beginner to Django and stuff. I really interested to watch. But I have feedbacks for you. 1. Please Make App Clones from Django Stack (as I mentioned above). You can start for example : - Blog using Django Stack (with react etc , as I mentioned above) - Search Engine - Social Network - Chat - Video Chat/Voice Chat - E-Commerce - Project Management Tools like Jira - Human Resource Management - IOT project - Computer Vision - AI Personal Assistant - Data Science - Machine Learning - or something else I believe it doesn't have to be complex (even though using all stack might look overkill, but what we need to know is the function for each stack in a whole), simple but fully functional it's good enough. So we can deploy it to Heroku or somewhere else that good for Django Stack (maybe kubernetes, I don't know, I'm still learning though). 2. Keep each video simple (for example, Video 1 - How to setup Django Video 2 - How to bla bla bla) Don't create 1 hour long video, hard to learn that way, especially when I want to learn specific part or topic. Short Videos with Sub Explanation (like in this video, I'm aware that youtube has feature to naming Parts of the video on red line play video. But instead using it for separating parts, you can use it for Sub Explanation. For example: How to install Django 0-1 min - Go to django website and install Django How to create virtual environment for Django 0-1 min - Creating directory on windows 1-2 mins - creating virtual environment and more. Make each video explanation to the point, don't confused it with jargons. If you want to do something, then you have to do this, etc. 3. Create Videos for Project that are ready to use for production (final video should be how to deploy video). Because after we follow along the tutorial, invested time to watch, we want the project to be ready to use, not give us things to tinker again. I mean, Imagine that we watched tutorials, and in the end, we can't use the project to production. 4. I believe Django + React is the future for web stack. I'm learning hard to master these things. So, if you create those things (in your way of course, I don't force you to create it as I said, I only recommend it), I believe it would help all Django Beginners like me. * fyi, I bought some courses on online learning websites, but some of those courses not good, because I paid for courses that I can't finished. I lost interest on the way, around 15-60% content of the course that I watched. The content just too long and boring, and not really useful for the final project that we learned at the end of the course. I started web development using vanilla HTML, CSS, JS, BOOTSTRAP, PHP, on Linux NGINX before, then when I started learning Django, I feel it would be a future of web stack. Especially when combined with React. Look forward to see it. Hope you consider my recommendations. Thankss! Good luck!

  • @primearchitech

    @primearchitech

    3 жыл бұрын

    @@hansalexander1051 Hey there, how is it going Did you make some of those projects?

  • @andrealvaradocampos4050
    @andrealvaradocampos40503 жыл бұрын

    hi so great video tutorial i have a error plz help my WebSocket connection to 'ws://127.0.0.1:8000/ws/chat/asdasd/' failed: Error during WebSocket handshake: Unexpected response code: 500

  • @aryanrathee5098

    @aryanrathee5098

    5 ай бұрын

    updates ? I have the same error

  • @amaangigani9372
    @amaangigani9372 Жыл бұрын

    I'm getting an error that socket could not connect. I downloaded the repo from you but even that shows the same error.

  • @HAL_NlNETH0USAND

    @HAL_NlNETH0USAND

    Жыл бұрын

    I can't establish the web socket as well. The routing can not find the /ws/chat/....

  • @nokibulislam9423
    @nokibulislam94232 жыл бұрын

    somebody explain me the regex code

  • @user-jr3ki5lo1o
    @user-jr3ki5lo1o Жыл бұрын

    hii i have probleme connecting to the websockets i did everything you showed on the vid i just cant find the issue

  • @veryacademy

    @veryacademy

    Жыл бұрын

    WebSocket URL: Verify that you have the correct WebSocket URL. It should start with either "ws://" or "wss://" (for secure connections). Ensure that the URL includes the correct hostname, port number, and any additional path or query parameters required.

  • @aryanrathee5098

    @aryanrathee5098

    5 ай бұрын

    @@veryacademy updates ? I have the same error. i vaeified all of that

  • @potatoesama5789
    @potatoesama57893 жыл бұрын

    django.core.exceptions.ImproperlyConfigured: Cannot import ASGI_APPLICATION module 'core.routing' / how can i solve this

  • @helloworld2831

    @helloworld2831

    3 жыл бұрын

    Hi, did you solve this problem?

  • @potatoesama5789

    @potatoesama5789

    3 жыл бұрын

    @@helloworld2831 Unfortunately i didn't

  • @Tech-yh6le
    @Tech-yh6le Жыл бұрын

    I followed the tutorial twice but was unable to get it working on linux using firefox :(

  • @CallGojo
    @CallGojo3 жыл бұрын

    I keep getting this error when I try to use channels TypeError: __call__() missing 2 required positional arguments: 'receive' and 'send'. Seems like a lot of folks who have tried to install channels have received this error. Did you face this issue? If not, really curious as to why

  • @rayzecor

    @rayzecor

    3 жыл бұрын

    It's quite difficult to give a reason as to "why" when it *didn't* happen. Have you tried downgrading or upgrading your python version? I'm running 3.7 and it's fine. Twister can't be installed on 3.9 so far, for example.

  • @matiotech86

    @matiotech86

    2 жыл бұрын

    I am facing this issue ,😒 and i am stop watching this video

  • @123sid789
    @123sid7893 жыл бұрын

    Why didn't you use path instead of re_path in the consumers.py file?

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    Hello 123sid789. You will no doubt come across the use of regular expressions. I did this to support and expand learning - I backed this up with a tutorial explaining them enough to understand this particular case: kzread.info/dash/bejne/iadhlMl7YdqZZ7Q.html

  • @123sid789

    @123sid789

    3 жыл бұрын

    @@veryacademy Thanks for the response. Looking forward to many more videos in this series. Great stuff.

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    No problem, any more questions please just ask!

  • @hansalexander1051
    @hansalexander10513 жыл бұрын

    I got errors when installing channels. Installing collected packages: twisted, daphne, channels Running setup.py install for twisted ... error ERROR: Command errored out with exit status 1: Advise please. Thanks. Note: Python 3.8.5 Django 3.1

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    Have a look at the comments made by createlyf see if that helps you.

  • @hansalexander1051

    @hansalexander1051

    3 жыл бұрын

    @@veryacademy Solved it.. thanks

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    @@hansalexander1051 Nice one!

  • @raniarovich
    @raniarovich3 жыл бұрын

    Can this be done with python?

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    Hi Ran, I am using Python?

  • @kryostar_
    @kryostar_3 жыл бұрын

    I'm having issues with routing. "Cannot import ASGI_APPLICATION module 'core.routing'" Stuck at the around 40 minute into the video.

  • @user-iy2gp9bz1f

    @user-iy2gp9bz1f

    3 жыл бұрын

    yea to low on detail but I had a similar issue you might want to 1: no need create a new routing file but stick with the pre made asgi.py and update it just go to the documentation and read the installation guide, 2: are you sure there is not an error above that says there is an error in the routing.py file you might want to fix that if there is, 3: make sure they are all in the same folder I had to store everything in the core folder and not the app because I couldn't import it right and it worked. hope this helps

  • @shwetapandey2333

    @shwetapandey2333

    3 жыл бұрын

    i am facing similar issue

  • @user-iy2gp9bz1f

    @user-iy2gp9bz1f

    3 жыл бұрын

    @@shwetapandey2333 again no detail but you can always switch to node js cuz it’s a better language anyway and it’s faster and it has a bigger community so more libraries and better integrations with other stuff

  • @shubhamdhingra6089
    @shubhamdhingra60893 жыл бұрын

    It's not a very great way to let the client send the username to the chat room, as they might claim to be someone else. How do I get that done on the server-side?

  • @shubhamdhingra6089

    @shubhamdhingra6089

    3 жыл бұрын

    Anyway, very useful tutorial.

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    Hi Shubham, This tutorial just represents me starting to think about how best to deliver this type of content and get an idea of the interest. There are many many flaws to this and is nowhere near a useable product. I will follow this up in the future with something much more comprehensive.

  • @shubhamdhingra6089

    @shubhamdhingra6089

    3 жыл бұрын

    @@veryacademy Great, keep up the good work!

  • @rashid_vp
    @rashid_vp3 жыл бұрын

    After handshaking, I got this error. TypeError: object.__init__() takes exactly one argument (the instance to initialize) .Then disconnecting

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    Sorry cant really give you a good answer here. It does give you clues in the error with regards to the on argument. You need to try and follow that lead. Its just going to be something really simple if you are following the code example.

  • @rashid_vp

    @rashid_vp

    3 жыл бұрын

    @@veryacademy I solved the issue by editing in the routing.py in the app. There I added consumers.ChatConsumer.as_asgi()

  • @viniciusnau5740

    @viniciusnau5740

    3 жыл бұрын

    @@rashid_vp thanks a lot!!

  • @dRainCoverBand

    @dRainCoverBand

    3 жыл бұрын

    @@rashid_vp Many thanks for this fix, I had the same issue, and it was driving me round the bend!

  • @visoflo4208

    @visoflo4208

    3 жыл бұрын

    @@rashid_vp thank god you found this. How would it work in his tutorial, but not for us?

  • @KrishnaManohar8021
    @KrishnaManohar80213 жыл бұрын

    Is it possible to send attachments also? How can we Implement? can you take this series further?

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    Manu, anything is possible, as per normal. I will do the next part today, show you how to initially deploy it on the server. Its not the kindest experience deploying something like this for new devs.

  • @veryacademy

    @veryacademy

    3 жыл бұрын

    What I am thinking is that I want to explore Vue/React with this technology to build something interesting. I was thinking of cloning the facebook inbox page. But of course we can move away from chatrooms - many more interesting ideas. We will eventually end up doing more machine learning as well I would imagine. As per normal many great adventures, little time.

  • @aashayamballi

    @aashayamballi

    3 жыл бұрын

    @@veryacademy Yes! Integrating with react would be great. There is a not lot of content on KZread integrating react & django channels. One is there from JustDjango but it's little difficult to follow and its outdated. Because it's all class based component and no react hooks is used.

  • @KrishnaManohar8021

    @KrishnaManohar8021

    3 жыл бұрын

    @@veryacademy Okay. my suggestion go with react.

  • @KrishnaManohar8021

    @KrishnaManohar8021

    3 жыл бұрын

    @@aashayamballi +1