request.POST
is basically a dictionary returned. It contains csrfmiddlewaretoken
and all form data with name specified as key in the request.POST
dict.
So, as per your form, you can get the message data from textarea by simply writing
message_data = request.POST['message']
in view.py
.
If you want to display form in your style then do it manually. Otherwise, django provides few techniques to render form, and they are as follows:
{{ form.as_table }}
will render form as table cells wrapped in <tr>
tags,
{{ form.as_p }}
will render form wrapped in <p>
tags,
{{ form.as_ul }}
will render form wrapped in <li>
tags.
Now, it depends upon you, how you want your form to look on page.