Chapter 4. Forms and Validation
In this chapter, we will learn how to use forms to modify the content on our blog directly through the site. This will be a fun chapter because we will be adding all sorts of new ways to interact with our site. We will create forms for working with the Entry model, learn how to receive and validate user data, and finally update the values in the database. Form processing and validation will be handled by the popular WTForms library. We will continue building out views and templates to support these new forms, learning a few new Jinja2 tricks along the way.
In this chapter we shall:
- Install WTForms and create a form for working with the Entry model
- Write views to validate and process form data, and persist changes to ...
Get Learning Flask Framework 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.