Summary
This chapter was an introduction to forms in Django. We introduced some 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 allowing the automatic building of forms using models. We enhanced Bookr some more by building the book search functionality.
In the next chapter, we will go deeper into forms and learn how to customize the display of form fields, how to add more advanced validation to your form, and how to automatically save model instances by using the ModelForm
class.