You're an Admin Boss!4:13 with Lacey Williams Henschel
This video will take you through a short recap of what you’ve learned in this course.
You made it! 0:00 You now know everything there is to know about the Django admin, just kidding. 0:01 As you can tell, there's almost no end to the ways you can customize and 0:07 improve the functionality available to you in the admin. 0:11 Forgive me for being a little trite, but the sky truly is the limit. 0:15 From displaying fields in a tabular format, to making fields 0:20 editable in the list view, you've accomplished so much in this course. 0:24 Let's take a quick look back though the admin to review what you've learned. 0:28 We've done the bulk of our work in admin.py, but 0:33 let's scroll through this for a moment. 0:37 We didn't actually add that much code, did we? 0:39 That's the beautiful thing about the Django admin. 0:43 You can make some serious improvements without writing a lot of extra code. 0:46 So for example, in the Courses section, 0:50 we added those awesome admin actions that let us change the status of the courses. 0:53 We also disabled the delete function so that no one can delete courses. 0:58 And we have the search bar at the top to make it easier to find what we're 1:03 looking for. 1:07 We also added a bunch of information to this list of courses. 1:08 So for example, now we can see the time that a course was created. 1:12 We can see how much time a course takes to complete. 1:17 And we can see whether a particular course is live. 1:20 We can even change the status of courses from right here from the list view. 1:23 Plus, over on the right-hand side, 1:28 we can filter down to all the courses that are live, or 1:30 all the courses that are on Python, or all the courses created in 2015. 1:34 And on the detail page we have that really awesome markdown preview box. 1:39 Super helpful for 1:43 seeing if our markdown is going to render nicely or if we've made a mistake. 1:44 And if we back up a little bit, on the questions page 1:49 we've made all our answers appear in this tabular format. 1:54 All the fields aren't stacked on top of each other now, 1:57 which makes it much easier to input the information that we want to. 2:00 That was a ton of work just on a couple of models. 2:04 So if we hop over to the multiple choice questions. 2:08 Right off, we can see that we can quickly change the quiz that a question goes with, 2:14 and the order that it appears in right from the list view. 2:19 In the text model, on the detail screen, we made 2:24 the courses that the text goes with appear as a vertical list of radio buttons. 2:29 We also added this content field set so that we can expand it and 2:34 collapse whenever we want it or don't want it. 2:38 And hey, right off the bat, we changed Django Administration to say 2:41 Learning Site Administration, which makes so much more sense for our project. 2:45 And then, back over on the quiz model, 2:51 we can change the course that a quiz goes with. 2:54 And change the number of total questions that it has 2:57 right there from the list view. 2:59 We also added that neat feature where we can see how many 3:01 questions someone has to get right in order to pass the quiz. 3:04 So if we change this one to 10, and then save it, 3:08 we can see they only need to get 7 answers right in order to get a 70. 3:11 Plus, we can filter the quizzes by course and search for the quizzes that we need. 3:16 See what great work you did? 3:21 But that's not all you can do. 3:23 You can totally write your own templates, views and even URLs for the admin. 3:26 It's probably not necessary for most projects, but that capability is there. 3:31 You can also override basically any template in the Django admin system. 3:36 And you've had lots of practice with that now. 3:41 We overrode three templates in this course. 3:44 You can pass in your own CSS and 3:47 change the way the whole admin looks if you want to. 3:49 There are even some Django packages out there you can install just for 3:52 the admin that will add their own features and optimizations. 3:55 There is so much more out there for you to explore in the Django admin. 4:00 I hope you take some time to play around with your new skills. 4:04 Thank you so much for learning about the Django admin with me, you did great! 4:07
You need to sign up for Treehouse in order to download course files.Sign up