title: IIS Web Page Returns "Server Error 500" When I press "Submit" button (POST request)
body: <p>I am using Django framework to create simple web portal for my team. The main purpose of the web portal is to deliver the file to a server using paramiko.SSHClent(). If I run my project on the local server using "python manage.py runserver", then pressing the "Submit" button delivers the file from the user to the server.  </p>
  
  <p>The next step was to deploy the website. So, I used Windows Internet Information Service(IIS) Manager 8.5 to deploy my website. The website deployed, but there is one problem. If I press the "Submit" button, I get this error, "Server Error (500)"</p>
  
  <p>Here is the <strong>Detailed Error</strong> image:
  <a href="https://i.stack.imgur.com/fUVCE.png" rel="nofollow noreferrer">500 Server Error Detail IMAGE</a></p>
  
  <p>Here is the <strong>views.py</strong> file:</p>
  
  <pre><code>    from django.shortcuts import render, redirect
      from .forms import DocumentForm
      from django.contrib import messages
      import paramiko
      import os
      from . import file_mapping
  
  
      def uploadForm(request):
  
      if request.method == 'POST':
      form = DocumentForm(request.POST, request.FILES)
      if form.is_valid():
          form.save()
  
          document = request.FILES['document']
          client_name = form.cleaned_data.get('client')
          file_type = form.cleaned_data.get('fileType')
          print('Client Name: ' + client_name)
          print('File Type: ' + file_type)
  
          file_mapping.handle_uploaded_file(document)
          file_mapping.setupfilename(client_name, file_type)
          #file_mapping.connectCqaServer(document)
  
  
          messages.success(request, f'Your file has been uploaded.')
  
      else:
          form = DocumentForm()
          #messages.warning(request, f'Your file is Invalid')
  
      return render(request, 'forms/forms.html', {'form': form}) 
  </code></pre>
  
  <p>Here is the <strong>forms.html</strong> file:</p>
  
  <pre><code>    {% extends "blog/base.html"%}
      {% load crispy_forms_tags %} 
      {% block content %}
      &lt;div class="content-section"&gt;
       &lt;form method="POST" enctype="multipart/form-data"&gt;
           {% csrf_token %}
           &lt;fieldset class="form-group"&gt;
               &lt;legend class="border-bottom mb-4"&gt; Upload Name and File &lt;/legend&gt;
               {{ form | crispy }}
           &lt;/fieldset&gt;
  
           &lt;div class="form-group"&gt;
               &lt;button class="btn btn-outline-info" type="submit"&gt;Upload&lt;/button&gt;
           &lt;/div&gt;
       &lt;/form&gt;
      &lt;/div&gt;
      {%endblock content %}
  </code></pre>
  
  <p>Here is the <strong>Handler Mapping</strong> settings on the IIS Manager:
  <a href="https://i.stack.imgur.com/c8AYo.png" rel="nofollow noreferrer">HANDLER MAPPING IMAGE LINK</a></p>
  
  <p>Here is the <strong>IIS Log</strong>:</p>
  
  <pre><code>    2020-05-06 18:23:52 10.137.11.223 POST /forms/ - 80 - 10.25.75.1 
      Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+ 
      (KHTML,+like+Gecko)+Chrome/81.0.4044.129+Safari/537.36 
      http://spscvt.com/forms/ 500 0 0 164
  </code></pre>
  
  <p><strong>I DO NOT HAVE WEBDAV INSTALLED</strong></p>
  
  <p>Can someone please help out with this issue? From my research online, I found out that IIS doesn't allow POST method, but I don't know to remove POST restriction.</p>
  
  <p>Thanks</p>