title: Retain select option value after submit in Django
body: <p>I am not using Ajax or django forms. I have plain HTML select tag inside the form tag and sending the selected option value in my view. I want to retain the select option value after the submission. Currently, it comes to default value of 1 irrespective of my selection. Help would be appreciated.</p>
  
  <p>Here is my template code:</p>
  
  <pre><code>            &lt;form method = "post" action = "{% url 'index' %}"&gt;
                  {% csrf_token %}
                  &lt;label class="mainlbl"&gt;Vega&lt;/label&gt;
                  &lt;select name = "drop1" &gt;
                      &lt;option value="1"&gt;1&lt;/option&gt;
                      &lt;option value="2"&gt;2&lt;/option&gt;
                      &lt;option value="3"&gt;3&lt;/option&gt;
                      &lt;option value="4"&gt;4&lt;/option&gt;
                      &lt;option value="5"&gt;5&lt;/option&gt;
                      &lt;option value="6"&gt;6&lt;/option&gt;
                      &lt;option value="7"&gt;7&lt;/option&gt;
                      &lt;option value="8"&gt;8&lt;/option&gt;
                      &lt;option value="9"&gt;9&lt;/option&gt;
                      &lt;option value="10"&gt;10&lt;/option&gt;
                      &lt;option value="11"&gt;11&lt;/option&gt;
                      &lt;option value="12"&gt;12&lt;/option&gt;
                  &lt;/select&gt;
                  &lt;input class="btn btn-ocean btn-side-bar" type = "submit" value="Submit"&gt;
              &lt;/form&gt;
  </code></pre>
  
  <p>Here is my view for that:</p>
  
  <pre><code>def index(request):
      if request.method == "POST":
          vega = request.POST['drop1']
          vega = int(vega)
          gvo = GVOptimize('NSE', 'Nifty')
          data = gvo.get_optimal_strategies(vega)
          str1 = None
  
          for i in range(0, len(data)):
              if i == 0:
                  str1 = data[i]
  
              elif i == 1:
                  str2 = data[i]
  
              elif i == 2:
                  str3 = data[i]
  
              elif i == 3:
                  str4 = data[i]
  
              else:
                  break
          context_dict = {'str1': str1, 'str2': str2, 'str3': str3, 'str4': str4 'vega': vega}
          return render(request, 'demo/dashboard.html', context_dict)
      else:
          context_dict = {}
          return render(request, 'demo/dashboard.html', context_dict)
  </code></pre>