Summary
This chapter provided an introduction to forms in Django. We introduced several HTML inputs for entering data onto a web page. We talked about how data is submitted to a web application and when to use GET
and POST
requests. We then looked at how Django’s form classes can make generating the form HTML simpler, as well as allow us to automatically build forms using models. Finally, we enhanced Bookr some more by building the Book Search functionality.
In the next chapter, we will dive deeper into forms and learn how to customize the display of form fields, how to add more advanced validation to a form, and how to automatically save model instances by using the ModelForm
class.