Django select how to remember chosen value?
<p>I have a select. On item change I reload a page, but after reloading I have a blank item chosen. How to make remember chosen item?</p>

<p>teacher.html</p>

<pre><code>&lt;form id="form"  method="POST"&gt;{% csrf_token %}
       &lt;select name="choose_teacher" onChange="this.form.submit();" blank_choice='Please choose:' &gt;
       &lt;option value="{{ 0 }}"&gt;blank&lt;/option&gt;
           {% for item in query_results %}
               &lt;option value="{{ item.id }}"&gt;{{ item.title}} {{ item.name }} {{ item.surname }}&lt;/option&gt;
           {% endfor %}
       &lt;/select&gt;
&lt;/form&gt;
{{ teacher_id }}
</code></pre>

<p>views.py</p>

<pre><code>def teacher(request):
if request.method == 'POST':
    if 'choose_teacher' in request.POST:
        teacher_id = request.POST['choose_teacher']
        query_results = Teacher.objects.all()
        context = {'teacher_id': teacher_id,
                   'query_results': query_results}
        return render(request, 'planner/teacher.html', context)
else:
    query_results = Teacher.objects.all()
    context = {'query_results': query_results}
    return render(request, 'planner/teacher.html', context)
</code></pre>

<p>:edit:</p>

<pre><code>    &lt;form id="form" method="POST"&gt;{% csrf_token %}
    &lt;select name="choose_teacher" onChange="this.form.submit();"&gt;
        {% for item in query_results %}
            &lt;option value="{{ item.id }}"
                    {% ifequal teacher_id item.id %}selected{% endifequal %}&gt;{{ item.title }} {{ item.name }} {{ item.surname }}&lt;/option&gt;
        {% endfor %}
    &lt;/select&gt;
&lt;/form&gt;
</code></pre>