3 ms·
It has so many built in footguns, however. For instance,`SerializerMethodField`, in conjunction with a list endpoint, can generate a huge number of queries if o
by jeffdn 4y ago
It has so many built in footguns, however. For instance,`SerializerMethodField`, in conjunction with a list endpoint, can generate a huge number of queries if one doesn't prefetch appropriately, and this issue is very difficult to catch with a linter. Granular test coverage is difficult because the testable unit is the ViewSet or the Serializer. I think DRF is great for rapid prototyping and early stage development.
In the long term, with a lot of complexity and a large organization, a more mature architecture that relies on components that wrap tables, composed together to form components that wrap business logic, which are composed into endpoints. Something like that is much easier to test and more scalable for disparate teams to step into and understand.
- SEJeff 4y agoCan you point out a better generic framework for this? And starlette doesn’t count as Tom Christie is the author of both.
- jeffdn 4y agoI haven't found one, unfortunately -- just setting team-wide architecture policies, and then using linters extensively to make sure those policies are adhered to.
- SEJeff 4y agoThat's my experience as well. There isn't a nicer one than DRF / Starlette, but for a specific use case, you can get away with a custom one no problem.