title: How to access the value from select2 in django
body: <p>I'm a beginner in this.I have a select2 plugin with multiple inputs.I want to get all the option values when submitted as an array (to query in views.py).
  for eg: [2,134,4,65]</p>
  
  <p>template</p>
  
  <pre><code>&lt;div class="col-sm-9"&gt;
      &lt;h1&gt;Hello {{user.first_name}} {{user.last_name}}....&lt;/h1&gt;
      &lt;h4&gt;Please Specify Your Symptoms&lt;/h4&gt;
      &lt;select class="js-example-basic-multiple" name="states[]" multiple="multiple" style="width:300px"&gt;
      {% for sym in all_symptoms %}
      &lt;option value={{sym.syd}}&gt;{{sym.symptoms}}&lt;/option&gt;
      {% endfor %}
      &lt;/select&gt;
      &lt;button type="submit" class="btn btn-success"&gt;Submit&lt;/button&gt;
    &lt;/div&gt;
    &lt;script&gt;
      $(document).ready(function() {
  $('.js-example-basic-multiple').select2();
  });
    &lt;/script&gt;
  </code></pre>
  
  <p>views.py</p>