4 ms·
Proper Django Rest Framework should basically have zero view code. Treat Serializers as forms, point at them in the appropriate generic view (or viewset) subcla
by larrik 4y ago
Proper Django Rest Framework should basically have zero view code. Treat Serializers as forms, point at them in the appropriate generic view (or viewset) subclass, and you are done.
If you are writing view code in DRF, you are probably doing it wrong.
- physicsguy 4y agoI don’t think this is fair - the DRF views are a great starting point for a project but I don’t think I’ve ever worked on one where they’re totally sufficient without at least some modification in places if you don’t want to make use of signals (which are very difficult to debug!). Even things as simple as adding logging to calls on certain end points will require you do provide your own view method (which might then call the mixin’s provided method).