Answer the question
In order to leave comments, you need to log in
How to make the chat react differently to different groups of users in channels?
I made a chat
using this tutorial https://django.fun/docs/channels/en/3/tutorial/ . Now it is necessary that he would issue some other text along with their message to ordinary users, and only messages to users with rights registered in the admin panel.
Where and how to register a user check in consumers?
Answer the question
In order to leave comments, you need to log in
as a result, in def receive in consumers, I wrote if self.scope['user'].has_perm()
while everything works
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question