Skip to content

Classy Django REST Framework

Blueprint exploded view of a DRF class: its ancestors stacked as plates under the page they flatten into, a vertical MRO dimension, labelled attributes, methods and ancestors

Classy Django REST Framework (CDRF), at cdrf.co, is a reference that puts each of Django REST Framework’s class-based views and serializers on one page. Each page lists the class’s ancestors in method resolution order, every attribute and method it defines or inherits, the source code of each method and the class that defines it.

DRF builds its generic views by stacking mixins on GenericAPIView and APIView, so learning what a single view does usually means opening several files. We built CDRF at Vinta in 2015 to answer that on one page, modelled on Classy Class-Based Views (CCBV), which does the same for Django’s own class-based views. We still maintain it, and our Django team uses it when choosing a generic class or tracing where a method comes from.

Key takeaways

Use one page per class

CDRF shows everything a DRF view or serializer defines or inherits on a single page, with the source.

Read the ancestors first

The ancestors list gives the method resolution order, which decides whose method runs.

Find who defines a method

Each method is listed under the class that defines it, so you know which one to override.

Check your DRF version

CDRF covers DRF 3.9 to 3.16; for a newer release, check DRF’s source.

What does a Classy Django REST Framework page show?

Each page opens with the class’s import path and links to its documentation and source, then three sections:

  • Ancestors (MRO): the classes it inherits from, in method resolution order. For ListCreateAPIView that is ListModelMixin, CreateModelMixin, GenericAPIView, APIView and Django’s View.
  • Attributes: every class attribute with its value and the class that sets it, such as lookup_field = 'pk' from GenericAPIView.
  • Methods: every method with its source code, grouped by the class that defines it, including the ones a subclass overrides.

The sidebar groups the classes the way DRF’s modules do: generics, mixins, pagination, serializers, views and viewsets.

When is CDRF more useful than the DRF documentation?

DRF’s guide to generic views explains what each class is for. CDRF answers the questions that come up once you subclass one:

  • Which method do I override? ListCreateAPIView.post calls create, which comes from CreateModelMixin and calls perform_create. The page shows that chain without opening three files.
  • What does this class do by default? The attributes show defaults inherited from APIView, such as permission_classes set to AllowAny and session and basic authentication, before your settings change them.
  • Where does a serializer method come from? The serializer pages do the same for ModelSerializer and its ancestors, which helps when testing serializers or using more than one serializer in a view.

Which Django REST Framework versions does CDRF cover?

CDRF has pages for DRF 3.9 to 3.16, with a version selector at the top of each page. DRF had reached 3.18.3 on PyPI by November 2026, so for a class added or changed after 3.16, check the source in DRF’s repository. The project is open source on GitHub, and its README lists the steps for adding a DRF version. Open CDRF next to your editor the next time a DRF view does something you did not expect, and if you are designing an API on DRF, our Django development team can help.

Frequently asked questions

What is cdrf.co?

It is Classy Django REST Framework, a reference for Django REST Framework’s class-based views and serializers. Each class has one page with its ancestors, attributes and methods, and the source code of each method.

Is CDRF the same as CCBV?

No. Classy Class-Based Views (CCBV) covers Django’s own class-based views. CDRF is heavily based on it and does the same for Django REST Framework’s views and serializers.

Which Django REST Framework versions does CDRF cover?

DRF 3.9 to 3.16, chosen with the version selector on each page. For changes made after 3.16, check DRF’s source.

How do I find where a DRF method is defined?

Open the class’s page on CDRF and look at the Methods section. Each method is listed under the class that defines it, with its source code, so you can see which ancestor to override or call with super().

Who maintains Classy Django REST Framework?

Vinta built it in 2015 and maintains it. The code is open source on GitHub, and its README explains how to build it locally and add a DRF version.

References

Book a call

Ready for software that finally fits?

Bring us your care model and find the right technical partner to build it with you.