9.5 Putting It All Together

The end of Chapter 9 is the culmination of the last three chapters. In this chapter, we used the forms from Chapter 7 and the templates from Chapter 8 to create webpages that users can interact with, creating, modifying, and deleting content from the site.

We built webpages to create, update, and delete objects. We saw that when creating a view to use a form to create or update an object, the view must account for the three states a form may exist in. As such, views handling forms are typically also finite-state machines with three states. CBVs become very useful in this case because they make all three states of both the view and the form very simple to understand. Similarly, to properly handle CSRF (by enabling ...

Get Django Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.