As explained in this section of the documentation , you do not need use the automatic form generation method ( {{ form.as_p }}
) if you do not want to. It is enough that your template has the correct input
fields (with name
s appropriate to each field).
One way to find out what format is expected by a specific Form
is - in the shell for example - call the as_p
method and see what its output is:
>>> f = ContactForm(auto_id=True)
>>> print(f.as_p())
<p><label for="subject">Subject:</label> <input id="subject" type="text" name="subject" maxlength="100" /></p>
<p><label for="message">Message:</label> <input type="text" name="message" id="message" /></p>
<p><label for="sender">Sender:</label> <input type="email" name="sender" id="sender" /></p>
<p><label for="cc_myself">Cc myself:</label> <input type="checkbox" name="cc_myself" id="cc_myself" /></p>
Font
From here you can check if your manually created template conforms to what is expected by Form
, and if it is you can use it without problems.