17.8 Putting It All Together
Generic class-based views (GCBVs) are class-based views (CBVs) that come with predefined behavior. For this behavior to work correctly, existing attributes on the class must be overridden. Without these overrides, a GCBV will not function.
The major difficulty with GCBVs is the amount of content and overhead there is to learning them. Once understood, they become one of Django’s most useful features, as they allow developers to create views quickly and efficiently. It would be silly to try to write your own classes with these behaviors when you can use code that is publicly reviewed and has been in use since 2011 (Django 1.3’s release).
The biggest mistake I see beginners make with GCBVs is the attempt to use them ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access