Sometimes the data you get back from users isn't so great, or the name they wanted was already taken. Learn how to show errors to your users in responsible ways in this video.
- [Instructor] So we know what it's like in our form … if we pass in some bad data, right? … And the last time we put that no validate tag on … and put in some bad information and you can see … that our views were not able to handle it. … And that means that we don't have … proper server side validation. … The good news is is that we're really close to having it … because Django forms can handle so much of that for us. … So, let's go ahead and move over to our views.py … and make it so that our form here is able … to handle some bad information … if it was going to slip through our local validation. … So the main thing here is, we need to make it … so that if someone does a post request … and that post request is not valid, … we need to return back some information. … At this point in time, if we get into this if function, … well we actually return something there, … but if it's not the case, then we don't return anything. … So we're going to move this return just back one time, … do a Shift + Tab here and with that, …
- Creating form fields
- Using submitted data
- Adding models
- Using the ModelForms class
- Working with widgets
- Accepting files and multiple forms on a page
- Customizing formsets
- Using local validation
- Delivering errors responsibly
- Customizing forms
- Styling with CSS
Skill Level Intermediate
1. Getting Started with Forms
2. Working with Advanced Form Features
3. Customizing and Styling Form Appearance
Next steps1m 19s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.