By the way, have you looked at tortoise orm, which is a fully async python ORM with very Django-like syntax? [1]
You still have to update your code for example
MyModel.objects.get(name="something")
becomes MyModel.objects.async_get(name="something")
so even though tortoise orm syntax's is similar to django, everything else can be different, migrations etc ...I just started a small side project with fastapi + tortoise + postgresql + vuejs and so far it's a pretty fun and smooth experience!
For those of us a little out of the loop, is this implementation being developed with guidance from the core Django devs with a view to adopting into core?
(I tried to find any references in the Django forums but may have missed them)
I believe they intend to have native support for async with the ORM, but it’s a monumental feature to add with lots of edge cases. I believe about 50% of Django is it’s ORM.
The rednaks repo works great for just giving the new async stuff a go. If everything else is also using async.
I did some experimentation with this. And its a pain trying to migrate a production application that uses gevent and psycogreen2.
The documentation on the code migration path is pretty sparse.
The main hiccup that I ran into was psycogreen2 not being supported.
https://stackoverflow.com/questions/67735453/django-async-or...
https://github.com/rednaks/django-async-orm/discussions/9 https://github.com/rednaks/django-async-orm/discussions/6
Everything works great if everything is already using the regular threading and asyncio/async methods, or JUST gevent/psycogreen.
The django documentation suggests mounting WSGI into ASGI.
But, it breaks down immediately going between the two paradigms.
I put a little experiment together a bit ago to see what would work in production, and my results.