DOCTYPE html html head title Django contact title head body if errors

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<!DOCTYPE html>
<html>
<head>
<title> Django contact </title>
</head>
<body>
{% if errors %}
<ul>
{% for error in errors %}
<li style="color: red;"> {{ error }} </li>
{% endfor %}
</ul>
{% endif %}
<form action="" method="post">
<label> Имя </label> <br>
<input name="name" value=" {{ form.name }}" type="text">
<br>
<label> E-mail </label> <br>
<input name="email" value=" {{ form.email }}" type="text">
<br>
<label> Сообщение </label> <br>
<textarea name="message"> {{ form.message }} раз два </textarea>
<br>
<input value="Отправить" type="submit">
{% csrf_token %}
</form>
</body>
</html>