title: Django form returns method as GET instead of POST
body: <p>I've set method='POST' but print(request.method) in my view prints GET and I don't know why, so my button won't work and save the data,
  I have tried everything i know but my code doesn't get fix</p>
  <p>This my template where I have set method as POST in form tag and also I have set action of form with the url, I have also set formmethod as POST in button tag:</p>
  <pre><code>&lt;div class=&quot;row&quot;&gt;
  &lt;div class=&quot;col-12&quot;&gt;
      &lt;div class=&quot;card m-b-30&quot;&gt;
          &lt;div class=&quot;card-body&quot;&gt;
              &lt;form action=&quot;{% url 'create_production' %}&quot; method=&quot;POST&quot;&gt;
                  {% csrf_token %}
              &lt;div class=&quot;row&quot;&gt;
                  &lt;div class=&quot;col-lg-4&quot;&gt;
                      &lt;div class=&quot;p-20&quot;&gt;
                              &lt;div class=&quot;form-group&quot;&gt;
                                  &lt;label&gt;تاریخ&lt;/label&gt;
                                  &lt;div class=&quot;input-group&quot;&gt;
                                      &lt;div class=&quot;input-group-prepend&quot;&gt;
                                          &lt;span class=&quot;input-group-text cursor-pointer&quot; id=&quot;tdate&quot;&gt;&lt;i class=&quot;fa fa-calendar&quot; aria-hidden=&quot;true&quot;&gt;&lt;/i&gt;&lt;/span&gt;
                                      &lt;/div&gt;
                                      {{ form.date }}
                                  &lt;/div&gt;
                              &lt;/div&gt;
                              &lt;div class=&quot;form-group&quot;&gt;
                                  &lt;label&gt;نام شرکت&lt;/label&gt;
                                  {{ form.comName }}
                              &lt;/div&gt;
                              &lt;div class=&quot;form-group&quot;&gt;
                                  &lt;label&gt;&lt;/label&gt;
                                  {{ form.comId }}
                              &lt;/div&gt;
                              &lt;div class=&quot;form-group&quot;&gt;
                                  &lt;label&gt;نام محصول&lt;/label&gt;
                                  {{ form.prodName }}
                              &lt;/div&gt;      
                              &lt;div class=&quot;form-group&quot;&gt;
                                  &lt;label&gt;&lt;/label&gt;
                                  {{ form.prodId }}
                              &lt;/div&gt;                      
                      &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class=&quot;col-lg-4&quot;&gt;
                      &lt;div class=&quot;p-20&quot;&gt;
                              &lt;div class=&quot;form-group&quot;&gt;
                                  &lt;label&gt;&lt;/label&gt;
                                  {{ form.gradeId }}
                              &lt;/div&gt;
                              &lt;div class=&quot;form-group&quot;&gt;
                                  &lt;label&gt;نام گرید&lt;/label&gt;
                                  {{ form.gradeName }}
                              &lt;/div&gt;
                              &lt;div class=&quot;form-group&quot;&gt;
                                  &lt;label&gt;نوع گرید&lt;/label&gt;
                                  {{ form.gradeType }}
                              &lt;/div&gt;
                              &lt;div class=&quot;form-group&quot;&gt;
                                  &lt;label&gt;تولید&lt;/label&gt;
                                  {{ form.qty }}
                              &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class=&quot;col-lg-4&quot;&gt;
                      &lt;div class=&quot;p-20&quot;&gt;
                              &lt;div class=&quot;form-group&quot;&gt;
                                  &lt;label&gt;ظرفیت&lt;/label&gt;
                                  {{ form.cap }}
                              &lt;/div&gt;
                              &lt;div class=&quot;form-group&quot;&gt;
                                  &lt;label&gt;ظرفیت طراحی&lt;/label&gt;
                                  {{ form.designCap }}
                              &lt;/div&gt;
                              &lt;div class=&quot;form-group&quot;&gt;
                                  &lt;label&gt;برنامه&lt;/label&gt;
                                  {{ form.plan }}
                              &lt;/div&gt;
                              &lt;div class=&quot;form-group&quot;&gt;
                                  &lt;label&gt;واحد&lt;/label&gt;
                                  {{ form.unit }}
                              &lt;/div&gt;              
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;button type=&quot;button&quot; formmethod=&quot;POST&quot; class=&quot;btn btn-primary waves-effect waves-light&quot;&gt;تایید&lt;/button&gt;
              &lt;/form&gt;
              
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>and this is my views.py, code won't run the first if condition:</p>
  <pre><code>@login_required(login_url='login')
  @allowed_users(allowed_roles=['editor'])
  def create_production(request):
      print(request.method)
      if request.method == 'POST':
          comId = Company.objects.values_list('id', flat=True).get(userId=request.user)
          form = CreateProduction(request.user, comId, request.POST)    
          if form.is_valid():
              production = form.save(commit=False)
              production.user = request.user
              production.save()
              return redirect('/')
      else:
          comId = Company.objects.values_list('id', flat=True).get(userId=request.user)
          form = CreateProduction(request.user, comId)
      return render(request, 'production/production_form.html', {'form': form})
  </code></pre>