[Django]-Django Async Model Save()

6👍

await sync_to_async(chart.save)

should be

await sync_to_async(chart.save)()

The sync_to_async function wraps chart.save and returns an asynchronous version of it, which then still has to be called to execute.

👤eriks5

1👍

models in Django ≥ 4.2 have the asave method

👤am70

Leave a comment