Django: SynchronousOnlyOperation: You cannot call this from an async context – use a thread or sync_to_async
The error occurs because Jupyter notebooks has a running event loop. From documentation If you try to run any of these parts from a thread where there is a running event loop, you will get a SynchronousOnlyOperation error. Note that you don’t have to be inside an async function directly to have this error occur. … Read more