Private Chat - Real-Time Chat app - Part 6

Поделиться
HTML-код
  • Опубликовано: 16 сен 2024

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

  • @ajudmeister
    @ajudmeister  4 месяца назад +1

    🐞Bug alert!! The function get_or_create_chatroom is creating multiple empty chatrooms with this logic. Loop is faulty. Please see the updated code below:
    other_user = User.objects.get(username = username)
    my_private_chatrooms = request.user.chat_groups.filter(is_private=True)
    if my_private_chatrooms.exists():
    for chatroom in my_private_chatrooms:
    if other_user in chatroom.members.all():
    return redirect('chatroom', chatroom.group_name)
    chatroom = Group.objects.create( is_private = True )
    chatroom.members.add(other_user, request.user)
    return redirect('chatroom', chatroom.group_name)

  • @twiceasviewtiful
    @twiceasviewtiful 3 месяца назад

    Great stuff, thanks a lot.
    By the way I can think of at least 3 more video ideas for this real-time chat series if you would be interested.
    1) Infinite scrolling. Right now you can load all chat messages or last 30/50/etc. I think the proper way is to give the user last 30/50 messages and load more as they scroll up.
    2) Notifications and/or mentions. It would be great if you could let other users know that they were mentioned in a chat or messaged in private chat.
    3) In one of the previous videos you mentioned that you somehow can get current users online from redis layer so you woudn't need to access database every time someone enters or leaves the chat.

    • @ajudmeister
      @ajudmeister  3 месяца назад +2

      Hi, thanks for the feedback! Yes, these tutorials only scratch the surface and can be improved a lot. Infinite scroll with htmx I covered already in a different tutorial. Notifications I added already in my inbox tutorial and I will cover it again in my next series coming soon. Yes, redis can give you access to more information about users connected to a channel layer and we don't need to access the "slower" postgres database. But for this we would need to set up a local redis database aswell. I will look into this in my next tutorial series aswell. Thanks for the great suggestions!

  • @user-iu8kt2xn4w
    @user-iu8kt2xn4w 5 месяцев назад +1

    Great stuff Bro, continue this way

  • @bondbenz6375
    @bondbenz6375 5 месяцев назад +1

    Great work

  • @aswoo-xk3en
    @aswoo-xk3en 5 месяцев назад +1

    thanks for creating such nice content. the problem I am facing is that I dont have good fundamentals, concepts, logic. I got a task to complete but unable to do that bcz I dont have fundamentals strong. my request from you is to create a playlist for django fundamentals- Backend focused

    • @ajudmeister
      @ajudmeister  5 месяцев назад +1

      Hi, I got you. Have you already checked out my backend tutorial series? There you can leanr the fundamentals from scratch ruclips.net/video/AZtu2Bain2Is/видео.html

  • @aashayamballi
    @aashayamballi 5 месяцев назад

    thank you!

  • @frameff9073
    @frameff9073 5 месяцев назад

    good thank

  • @HarshMohta
    @HarshMohta Месяц назад

    I am still getting the same bug
    no reverse match error after using the updated code as well

    • @ajudmeister
      @ajudmeister  Месяц назад

      No reverse error has to do with an incorrect url pattern, missing url parameter or maybe just a type error somewhere. You should try to debug it step by step with print() to see where the code breaks. I would need to see your urls, view and template code to give you more advice.

  • @ntwarioscar
    @ntwarioscar 5 месяцев назад

    is it possible to have different user list in sidebar then when we click on user with htmx then chat with user and receive messages from user please if possible It will be good thanks

    • @ajudmeister
      @ajudmeister  5 месяцев назад

      Do you mean when you click on a user in the sidebar you want to show a pop up with the chat? Yes you can do that by loading in the chat page with htmx in a modal window.

    • @ntwarioscar
      @ntwarioscar 5 месяцев назад

      @@ajudmeister thanks for reply ohh yes I mean that way do you see like discord or whatsapp how we chart? you click on users in sidebar then the chart also change then start to chart then click on others users and also so chart thanks

    • @ntwarioscar
      @ntwarioscar 5 месяцев назад

      @@ajudmeister you can see what we have done currently we are redirecting it's like reloading the page I mean can we use htmx to do those features click on chart above then chart be changed without reloading thanks