Unable to run async functions after migrating from WSGI to ASGI in Django Rest Framework

Viewed 147
  • While implementing channels feature in DRF I migrated from WSGI to ASGI.
  • So currently I have REST API and channels in same project->same app.
  • Channels are working and existing APIs as well except ones with async def in it

Im getting error below -

RuntimeError: You cannot use AsyncToSync in the same thread as an async event loop - just await the async function directly.

Since this method is called in a view which not async I cannot await while calling function. Im assuming the WSGI->ASGI migration is cause of this break.

HELP PLEASE!!

0 Answers
Related