运行时:
async def func():
print("This is async function")
Program.objects.create(name="New Program")
asyncio.run(func())
得到这个:
Error : SynchronousOnlyOperation: You cannot call this from an async context - use a thread or sync_to_async.
谁能帮我解决这个问题?