3 ms·
I am not part of the DSF or anything but I can say with a good amount of confidence that the answer to this is “No”. Moving to a Pydantic-style model would be
by rtpg 2y ago
I am not part of the DSF or anything but I can say with a good amount of confidence that the answer to this is “No”.
Moving to a Pydantic-style model would be a whole different ballgame. Hell of a lot of work, and meanwhile we can’t even really get to “let’s have type hints in some of the Django infernals”.
But! I do think someone who wants to have fun could try to build a type hint based Model subclass as a third party lib! There’s a looooot of stuff to resolve in that world but for any proposal like that the general vibe is “prove the feasibility with a third party package first”.
- c-fe 2y agoI think there is potential for a new python web framework with batteries included (like django) but using newer paradigms (typing, …). Fastapi itself is a nice concept but its a bit of a mess (the main author just keeps closing bug issues and adds somewhat useless things (just check the git commit log)), and also it requires db tooling (sqlalchemy) and other things
- IceWreck 2y agoYou should check out litestar It's essentially what you described and it's growing in popularity.
- c-fe 2y agoThanks, ill check it out!
- physicsguy 2y agoIt's really nothing like Django, which is a full stack development framework. This is more akin to Django REST Framework or Django Ninja which are REST API frameworks that sit on top of Django.
- rtpg 2y agoI kind of agree, though at least Django with type stubs gets me 95% of the way there. At the end of the day I end up writing a service layer over everything so I'm not super bugged by most of this. But it's busywork when first starting up a project.
- physicsguy 2y agoIt's also super clunky if you get into certain advanced things because it's built on top of Starlette and piggybacks off much of that. Want to adjust how many background threads you want running? Oh wait, you can't, it's a Starlette setting that's not really exposed.