3 ms·
I wish Django would take async more seriously. This comment gives a pretty good overview of the current situation (some points are more valid than others): http
by miiiiiike 3y ago
I wish Django would take async more seriously. This comment gives a pretty good overview of the current situation (some points are more valid than others): https://github.com/encode/django-rest-framework/discussions/7774#discussioncomment-6361530 https://github.com/encode/django-rest-framework/discussions/...
The Python ecosystem is strange. Where other dev communities will embrace new ways of doing things faster than most people can keep up — the Python community needs to be pulled kicking and screaming into the light once ever decade or so. Python 2 to 3, ~10 years.
async/await has been in Python since 2015, it feels like it's going to be another 5 years before we see people taking async seriously in the big packages. Same problem we had during the 2/3 transition. No library support, no developer support.
- andrewstuart 3y agoHave a look at Starlette, it’s by the guy who made Django. FastAPI is built on Starlette and adds more batteries included. If you’re interested in async you’re far better off to go async native than with a framework that’s synchronous. Asyncpg is the fastest Python Postgres driver there is, works well with sanic, Starlette or FastAPI.
- henry_viii 3y agoCorrection: Starlette is made by the guy who made the Django REST Framework, not Django. DRF is a separate project from Django.
- andrewstuart 3y agoThanks.
- miiiiiike 3y agoThe Starlette dev is the founder of Django Rest Framework.. Which is my least favorite part of working with Django. I really wish Django shipped with its own REST Framework. I’ve been keeping an eye on FastAPI, Starlette, and a few other libraries but, compared to Django, they’re mostly powered by hype. I found a bunch of Pydantic bugs 2(3?)+ years ago that are only now getting addressed in v2.
- Takennickname 3y agoDjango does come with it's own rest framework built in. Instead of rendering to templates, just return json.
- miiiiiike 3y agoThere are a lot of other things to consider. Django only supports GET and POST out of the box and Django forms aren’t serializers. Those are just the obvious ones. Just returning JSON isn’t practical.
- v3ss0n 3y agoNone of the mini-framework based on Starlette is close to Django's fullstack facility, but upcoming litestar 2.0 have a lot of features that Django people desires. We have DTO + Repository + Sqlalchmey plugin system , that - just with definition of SQlalchmey 2.0 model , it will give you and DDD style Repository Service with CRUD , Filtering , Pagination , and many common apis by default . Those need Extension in django. For CRUD : https://github.com/litestar-org/litestar-pg-redis-docker/ https://github.com/litestar-org/litestar-pg-redis-docker/ For fullstack experience see : https://github.com/cofin/litestar-fullstack https://github.com/cofin/litestar-fullstack - it has Users and Auth , Roles , Teams , Tagging , Data migration , Caching , Background Worker Services , Background scheduling , manage.py-like cli for creating users , admin users , and docker containers.