M
M
mr_good_cat2021-05-21 13:38:10
Django
mr_good_cat, 2021-05-21 13:38:10

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

1 answer(s)
M
mr_good_cat, 2021-05-21
@mr_good_cat

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 question

Ask a Question

731 491 924 answers to any question