I have a form like the following:
class MyForm(Form):
#personal data
firstname = CharField()
lastname = CharField()
#education data
university = Char
If you want to customize the form, you don't have to render it form.as_ul
. Django knows how to render foobar if you have set up the forms model properly...try it...no worries.
Look at what python on the server sent your page. For example if it sent a django form like this:
return respond(request, user, 'templateName', { 'myform':myform })
then templateName.html will have:
<blockquote>
<form>
<p>Here you enter your personal data...</p>
{{myform.firstname }}
<p>Here you enter your education data...</p>
{{myform.university }}
<p> a choice field </p>
{{myform.foobar}}
</form>
</blockquote>
Remember also that a Django Form object is just a collection of fields; there is no need for a 1:1 correspondence between HTML form tags and Django Form objects. If the various sections of the form are actually logically separate, you could consider splitting it up into three Forms, which you could then render in your template with any HTML you want between them (but still within a single HTML form tag).
Whether this is a sensible solution depends quite a bit on the design of your app and the view, of course.