A More Accessible Django Girls
Published July 11, 2015
Lacey Williams Henschel
https://pretalx.com/pycascades-2021/talk/NH8C8U/
My goal with this talk is to make Django REST Framework easier and more approachable for developers who are new to DRF. Many people feel that you should start in DRF with the APIView and a manual serializer, but I disagree! DRF ships with some powerful tools that make developers' lives easier, and many people never even learn what those tools are. Using the built-in tools like ModelViewSet, coupled with always having Classy DRF open in a tab, helped me gain a full understanding of how DRF worked (and a better understanding of how Django worked).
This talk is not a DRF tutorial.
ModelViewSet and how it's composed of all the mixins that allow you to perform different operations on your database objects (CreateModelMixin, RetrieveModelMixin, etc.).permission_classes, queryset, and serializer_class.get_serializer_class() to return different serializers for List vs. Detail requests.permission_classes to create modular permissions. Note: This will not cover how to write custom permission classes, only how to use them.APIView and the necessary mixins. Notes on when you might use them (example: you want a viewset that allows all actions except delete)I will be referring to Classy DRF throughout the talk. In my experience, many people find the Classy Class-Based Views, Classy DRF, and that family of helper websites confusing, until they learn how to use them. I want to help the audience learn to use these tools.
Note: This is a new talk for me. I tend to rehearse my talks a lot, so if time is too tight I will know that ahead of time. The section I would cut for time would be "Overview of the generic views," because this idea will be introduced in the ModelViewSet section.
After three amazing in-person conferences, this time we're moving PyCascades online.
PyCascades is a regional PyCon in the Pacific Northwest, celebrating the west coast Python developer and user community. Our organizing team includes members of the Vancouver, Seattle, and Portland Python user groups.
Videos are released as CC BY-NC-SA 4.0.
Produced by Next Day Video Australia: https://nextdayvideo.com.au
#pycascades #pycon #python #conference
Sat Feb 20 11:05:00 2021 at Prerecorded Talks
Note: We understand that names change, people change, and bodies change. We respect each individual's journey and privacy. If you have any concerns about a video or need us to remove content, please don't hesitate to contact us. We will handle your request with care and promptly address any issues.