title: Get form returning None - Django 2
body: <p>I'm trying to filter a view based on a input form. It means that I want to store the input variables and filter the view's model with this.</p>
  
  <p>There's two ways to do this: by POST or by GET. I've tried both of them, but I believe that GET method is more useful.</p>
  
  <p>I don't know if the problem is that I'm not using a form on forms.py or something on urls.py, views.py and the html template.</p>
  
  <p>Anyway. Here is my code:</p>
  
  <p><strong>views.py</strong></p>
  
  <pre><code>class PareceresHistAsset(LoginRequiredMixin, ListView):
      login_url = 'login/'
      redirect_field_name = 'redirect_to'
      template_name = "dash_asset.html"
  
      # Obtendo o ano anterior ao vigente
      ano = datetime.now().year - 1
      # Model Utilizado
      model = Pareceres
      queryset = Pareceres.objetos.filter(data_comite__year__gte=ano).filter(segmento='asset')
  
      # Criando os dados de context da view
      def get_context_data(self, **kwargs):
          ## Queryset do objeto
          queryset = self.queryset
  
          # Teste
          data_inicial = self.request.GET.get('data_inicial')
          print(data_inicial)
  ...
  </code></pre>
  
  <p><strong>urls.py</strong></p>
  
  <pre><code>from portal.views import *
  from django.urls import path
  from django.contrib.auth.views import LoginView
  
  app_name = 'portal'
  
  # urlpatterns contém a lista de roteamento URLs
  
  urlpatterns = [
      # GET /
  ...
      path('asset/dash', PareceresHistAsset.as_view(), name='dash_asset'),
  ...
  ]
  </code></pre>
  
  <p><strong>dash_asset.html</strong></p>
  
  <pre><code>&lt;div class="card mt-3"&gt;
      &lt;div class="card-body"&gt;    
          &lt;form method="get"&gt;
              &lt;div class="row"&gt;
                  &lt;!-- Data Inicial--&gt;
                  &lt;div class="col-2"&gt;
                      &lt;label for="data_inicial"&gt;Data Inicial&lt;/label&gt;
                      &lt;input id="data_inicial" width="150" name="data_inicial"/&gt;
                  &lt;/div&gt;
                  &lt;!-- Data Final --&gt;
                  &lt;div class="col-2"&gt;
                      &lt;label for="data_final"&gt;Data Final&lt;/label&gt;
                      &lt;input id="data_final" width="150" name="data_final"/&gt;
                  &lt;/div&gt;
                  &lt;!-- Botão Submitt--&gt;
                  &lt;div class="col-3 text-left"&gt;
                      &lt;br&gt;
                      &lt;button class="btn btn-primary btn-sm" id="filtra_datas" type="submit"&gt;Atualizar&lt;/button&gt;
                  &lt;/div&gt;
          &lt;/form&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And the javascript used in the input form</p>
  
  <pre><code>    &lt;!-- Material Design Date Picker --&gt;
      &lt;script src="https://unpkg.com/gijgo@1.9.11/js/gijgo.min.js" type="text/javascript"&gt;&lt;/script&gt;
      &lt;link href="https://unpkg.com/gijgo@1.9.11/css/gijgo.min.css" rel="stylesheet" type="text/css" /&gt;
  
  
      function formatDate(date) {
          var d = new Date(date),
              month = '' + (d.getMonth() + 1),
              day = '' + d.getDate(),
              year = d.getFullYear();
  
          if (month.length &lt; 2) month = '0' + month;
          if (day.length &lt; 2) day = '0' + day;
  
          return [day, month, year].join('/');
      }    
  
      $('#data_inicial').datepicker({ 
          format:
  
   'dd/mm/yyyy',
      value: '01/01/2019',
  });
  $('#data_final').datepicker({
      format: 'dd/mm/yyyy',
      value: formatDate(Date())
  });
  </code></pre>
  
  <p>When I submit the form, only a question mark is added to my url.
  It came from <a href="http://127.0.0.1:8000/asset/dash" rel="nofollow noreferrer">http://127.0.0.1:8000/asset/dash</a> to <a href="http://127.0.0.1:8000/asset/dash" rel="nofollow noreferrer">http://127.0.0.1:8000/asset/dash</a>? .</p>
  
  <p>Another thing is that variable data_inicial (inside get_context_data) returns none. </p>
  
  <p>Anyone knows how to solve it?</p>
  
  <p>I'm stuck on this for like three days.</p>
  
  <p>Thank you.</p>
  
  <p><strong>Edit:</strong> 
  Inserted the name attribute on inputs and corrected the name and id from data_incial to data_inicial.</p>
  
  <p>Still returning None</p>