| 1 | <html lang="en"> |
| 2 | <head> |
| 3 | <title>Captcha test</title> |
| 4 | <style> |
| 5 | body { |
| 6 | background-color: #eee; |
| 7 | padding: 2rem; |
| 8 | font: 400 1rem/1.5 sans-serif; |
| 9 | } |
| 10 | |
| 11 | input[type="text"] { |
| 12 | display: inline-block; |
| 13 | height: 32px; |
| 14 | width: 4.5rem; |
| 15 | vertical-align: top; |
| 16 | margin: 0 0.25rem; |
| 17 | border: 1px solid #ccc; |
| 18 | text-transform: uppercase; |
| 19 | } |
| 20 | input[type="submit"] { |
| 21 | display: inline-block; |
| 22 | height: 32px; |
| 23 | width: auto; |
| 24 | border: 1px solid #ccc; |
| 25 | background-color: black; |
| 26 | color: white; |
| 27 | padding: 0.25rem 0.5rem; |
| 28 | margin: 1rem 0; |
| 29 | } |
| 30 | p.ok { |
| 31 | color: forestgreen; |
| 32 | } |
| 33 | ul.errorlist { |
| 34 | list-style-type: none; |
| 35 | color: red; |
| 36 | padding: 0; |
| 37 | } |
| 38 | </style> |
| 39 | </head> |
| 40 | <body> |
| 41 | <form action="." method="post"> |
| 42 | {% csrf_token %} |
| 43 | |
| 44 | {% if 'ok' in request.GET %} |
| 45 | <p class="ok">Correct answer</p> |
| 46 | {% endif %} |
| 47 | {{ form.captcha.errors }} |
| 48 | {{ form.captcha }} |
| 49 | |
| 50 | <div> |
| 51 | <input type="submit" value="Submit" /> |
| 52 | </div> |
| 53 | </form> |
| 54 | </body> |
| 55 | </html> |