Summary

This chapter probably had the least amount of code written for any chapter in this book. However, the functionality that we built here is probably more complicated than what we built in most chapters. I said at the start of the chapter that one of the reasons for the popularity of the Django framework is the admin app. I hope that by now you agree with me.

With less than 20 lines of code, we were able to create a system that rivals most CMS systems out there and is still more tailored to our client's needs. Unlike most CMS systems, we don't treat Car and Booking objects as pages or nodes. In our system, they are first-class objects, each with its own fields and individual functionality. However, as far as the client is concerned, the admin works like it would for any CMS, probably easier, because there are no extra fields like there are in most CMS solutions.

We have barely begun to scratch the surface of customizing the admin. There are a lot of features provided by the admin, catering to most scenarios required by an administration panel. All of this power is easily available to use by changing a few settings on ModelAdmin. In all the Django applications that I have developed, I have needed to create a custom administration panel only once. The Django admin is so customizable that you just configure it to match what you need.

I highly recommend that you look at the documentation of the Django admin at https://docs.djangoproject.com/en/stable/ref/contrib/admin/. If you ever need to create an administration project for your web application, do check whether the admin provides the functionality that you want. More often than not, it does and saves you a ton of effort.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.103.154