hi , i checked your code , so if you want to call all message when a users 
is connected , you have to create a function to call all messages when 
websocket is connected ,
Saisissez lfrom datetime import datetimee code ici...e code ici...

 function:

Saisissez le code ici.
@database_sync_to_async
def get_all_message(self):
    return Message.objects.all()..


put in the end of classe ChatConsumer according to your code after def 
chat_message. if is ok, go to add the following code after self.accept(): 
change self.accept() to await self.accept() 
Saisissez le code 

mess = await self.get_all_message()
for m in mess:
data = {
'author':m.user.username,
'message':m.message,

}
await self.send(text_data=json.dumps(data))
ici...
if you still have concerns i am available to help you further email : 
cedric.gb...@uvci.edu.ci contact : 00225 77 53 08 22 

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6161317e-2e1c-400e-8343-acf9c55cf95fo%40googlegroups.com.

Reply via email to