Answer the question
In order to leave comments, you need to log in
Why doesn't database_sync_to_async work in Django?
Good day, you need to get access to the desired session in the connect () method of the consumer, so far there is something like this code:
async def connect(self):
session = await database_sync_to_async(SessionStore(session_key = self.scope["user"].session_key).values())()
...
await self.accept()
session = SessionStore(session_key = self.scope["user"].session_key)
session.values()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question