From the course: Introduction to Django

Unlock this course with a free trial

Join today to access over 24,400 courses taught by industry experts.

Forms

Forms

- Okay, so now let's talk about Django Forms, and honestly, this is the one of the features of Django that I use the least just because it hasn't been necessary for many of my projects, but it's a cool feature of Django. You can define forms in Django using Python, kind of the similar way that we define our database schema in Python using models, then you can render them in the template in different formats like so, like there's these different ways to display them, but it can take a lot of custom CSS to make these look good. If you're using a CSS framework and want to easily style the forms, you can use third-party extensions like django-crispy-forms. I'm using django-bulma, and so I've got a form that looks like this. So, I would say like the visual representation of the form is not the most handy part of it, it's actually being able to define it in the backend and doing validation and saving the data. If you're going to use forms for something, you would definitely use it for that.…

Contents