From the course: Django: Forms

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Form rendering

Form rendering

From the course: Django: Forms

Start my 1-month free trial

Form rendering

- [Instructor] Up 'til this point, whenever we've had a Django form we've just displayed it in the default way however it is. You can see it's just sort of lined up left to right here. There's actually a couple of different ways that we can have our forms displayed, and I'm going to show you how to do that now. Let's go ahead and move back into our code and we're going to go to our order.html, and we're going to look at a couple different ways to lay out our form. First, inside of our order form here, we have our pizzaform. After pizzaform, we're going to do a .as_p, and what this is going to do is it's going to display our form in some paragraph tags. Let's go ahead and save this, go back to our home page, let's reload, and look at this. If this is more of your style, having things top to bottom, we can have that listed out there. And, to really see what this looks like, let's go ahead and inspect the HTML here, and you can see here's our form, and then, inside of the form, there's a…

Contents