Django Forms

Treehouse
Course Summary
Django Forms let us quickly create HTML forms and validate information from users and APIs. Django gives us two types of Forms, basic Forms and Model Forms, which turn our Models into Forms. Our learning app needs quizzes, so let's build them with Forms!
-
+
Course Description
About this Course Django Forms let us quickly create HTML forms and validate information from users and APIs. Django gives us two types of Forms, basic Forms and Model Forms, which turn our Models into Forms. Our learning app needs quizzes, so let's build them with Forms! What you'll learn
- Forms
- Model Forms
- Data validation
- Model inheritance
About the Teacher
Besides teaching Python at Treehouse, Kenneth Love is a husband & father. He created a few popular Python libraries, worked at most levels of the web stack, & was the Creative Director of a newspaper. He likes board games, whiskey, activism, & dry humor.
-
+
Course Syllabus
Forms
Basic Forms in Django are handy for data validation and non-model-based data entry. They automatically create their own HTML and do some serious validation. 13 steps- What are Forms in Django? 1:58
- Creating a Form 4:04
- Create a Simple Form 4 objectives
- Showing a Form in a View 8:18
- Instantiate a Form in a View 3 objectives
- Handling a Form in a View 10:10
- Validate a Form in a View 2 objectives
- Custom Field Validation 7:16
- Clean a Field 2 objectives
- Using and Creating Validators 3:38
- Create a Validator 2 objectives
- Cleaning a Whole Form 4:28
- Clean Two Fields 1 objective
More on Models
To create our quizzes, we're going to need a few more models. And since a few of them share a lot of information and functionality, let's look into inheritance with multiple tables and abstract models. 7 stepsModel Forms
Quite often, we just want a form that represents a model in our app. Django gives us a great way to handle that scenario with Model Forms. 10 stepsInlines and Media
Now that we have basic and model forms down, let's see how to use multiple forms, inline forms, and provide some special media to our forms. 7 steps