Public and Private Chat Room Creation with Django Python Framework

62 views
Skip to first unread message

Chukwudi Onwusa

unread,
Nov 20, 2022, 9:52:07 AM11/20/22
to django...@googlegroups.com
Greetings and good tidings!
Please how do I create with django the above mail subject(private and public chat room).
I need help and references to work on.
Thanks.

Lakshyaraj Dash

unread,
Nov 20, 2022, 9:55:00 AM11/20/22
to django...@googlegroups.com
Provide is_private to the rooms model of your app.
If you make the default as true, then the room is private by default and vice versa

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAGoV8nnwKZa%3DSYCfbcOX-n-3GRSOGTNgQKgz2%3DqF%2BMEddHGFig%40mail.gmail.com.

Chukwudi Onwusa

unread,
Nov 20, 2022, 5:33:46 PM11/20/22
to django...@googlegroups.com
Please can you help me with a sample.
Please.

Lakshyaraj Dash

unread,
Nov 20, 2022, 6:50:51 PM11/20/22
to django...@googlegroups.com
class Room(models.Model):
   ...
   is_private = models.BooleanField(default=False)

In views.py
def chat_room(request):
    if room.is_private:
       return redirect ("/")
    else:
       ...

Chukwudi Onwusa

unread,
Nov 21, 2022, 10:22:13 AM11/21/22
to django...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages