Django Class-based Views

Treehouse
Course Summary
Django view functions are simple and easy to use but sometimes you find yourself repeating a lot of the same work over and over. Luckily, Django also offers a way to create views as classes which can lead to cleaner, more reusable code. Class-based views have a lot of nooks and crannies, though, so let us show you around this powerful tool!
-
+
Course Description
About this Course Django view functions are simple and easy to use but sometimes you find yourself repeating a lot of the same work over and over. Luckily, Django also offers a way to create views as classes which can lead to cleaner, more reusable code. Class-based views have a lot of nooks and crannies, though, so let us show you around this powerful tool! What you'll learn
- Class-based views
- Generic views
- Mixins
About the Teacher
Besides teaching Python at Treehouse, Kenneth Love is a husband & father. He created a few popular Python libraries, worked at most levels of the web stack, & was the Creative Director of a newspaper. He likes board games, whiskey, activism, & dry humor.
-
+
Course Syllabus
Classy Views
Django class-based views are a great way to avoid repeating yourself. They provide a shortcut to common functionality but they're not the easiest thing to wrap your head around. Let me help you get a grip on this Django feature. 9 steps- What are Class-based Views? 2:22
- The View Class 7:27
- Basic View 3 objectives
- TemplateView 6:48
- TemplateView 3 objectives
- ListView and DetailView 6:48
- List and Detail 3 objectives
- CRUD Views 14:41
- CRUDs 3 objectives
Customizing Class-based Views
Class-based views wouldn't be nearly as useful if you couldn't tweak them to meet your needs. I'll show you how to combine view classes, use Django's provided mixins, and more to get just the view you need. 9 steps