ํด๋น ํ๋ฉด์ ์์์ ๋๋ค. ๋ํ ์ผ์ด ์ฝ๋๋ง๋ค ์กฐ๊ธ ๋ค๋ฅผ ์ ์์ต๋๋ค.
1. form ์ ์ฉ ํ๋ฉด
2. detail.html ์ฝ๋
<form action="{% url 'polls:vote' question.id %}" method="post">
{% csrf_token %}
<fieldset>
<legend><h1>{{ question.question_text }}</h1></legend>
{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %}
{% for choice in question.choice_set.all %}
<input type="radio" name="choice" id="choice{{ forloop.counter }}" value="{{ choice.id }}">
<label for="choice{{ forloop.counter }}">{{ choice.choice_text }}</label><br>
{% endfor %}
</fieldset>
<input type="submit" value="Vote">
</form>
3. ๊ณผ์ 2: ์ html ์ฝ๋๋ฅผ ์ ์ฉํ ํ๋ฉด ์บก์ณ (form ์ ์ฉ) + ์ฝ๋ ์ค๋ช
* ์ฝ๋ ์ค๋ช ์ ๊ผญ ๋ค์ด๊ฐ์ผ ํ ๋ด์ฉ (ํ์)
- ๋ฐ์ดํฐ์ ํ๋ฆ์ ๋ํ ์ค๋ช
- csrf_token์ด๋?
- ์ฌ์ฉ์๊ฐ ์๋ฒ๋ก ์ด๋ป๊ฒ ๋ฐ์ดํฐ๋ฅผ ๋ณด๋ผ๊น์? (input type๊ณผ submit์ ๋ํ ์ค๋ช )
- ์ ํ์ง๋ฅผ ์ ์ถํ์ ๋ ๋ทฐ์ ํธ์ถ ๊ณผ์ ์ ๋ํ ์ค๋ช