I am trying to create a django form . Like as follows
class AForm(form.Form):
first_name = forms.CharField(max_length=1000)
last_name = forms.CharField(max_length=1000)
And I do have the html code like
<form action="zzzzzz" method="post">
{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Submit" />
</form>
I want first name and last name next to each other .
Is it possible to do UI layout inside django form , itself, rather than at html page ?
Thanks
J
You can customize form layout by overriding
as_p/as_tablemethods. For example:Where
forms/AForm.htmlis a valid Django Template