title: django MultiValueDictKeyError and RuntimeError in saving a form's data in database
body: <p>I am trying it very hard but I didn't find what I am missing. I have made a form that contains fields like the first name, last name, address, city, state, zip and one Image file from the user.</p>
  
  <p>But I am getting this error when I was trying to post data by views.</p>
  
  <pre><code>MultiValueDictKeyError at /submit_your_task
  
  'image'
  
  Request Method:     POST
  Request URL:    http://127.0.0.1:8000/submit_your_task
  Django Version:     2.2.4
  Exception Type:     MultiValueDictKeyError
  Exception Value:    
  
  'image'
  
  </code></pre>
  
  <p>and this is my views.py for that form</p>
  
  <pre><code>def submit_your_task(request):
      if request.method == 'POST':
          first_name = request.POST['first_name']
          last_name = request.POST['last_name']
          address = request.POST['address']
          phone = request.POST['phone']
          city = request.POST['city']
          state = request.POST['state']
          zip = request.POST['zip']
          image = request.FILES['image']
          fs = FileSystemStorage()
          file = fs.save(image.name, image)
          url = fs.url(file)
          submit_task = SubmitYourTask(first_name=first_name, last_name=last_name,
                                       address=address,
                                       phone=phone, city=city,
                                       state=state, zip=zip, image=url)
          submit_task.save()
      return render(request, 'submit_task.html')
  </code></pre>
  
  <p>and this is urls.py</p>
  
  <pre><code>from django.urls import path
  from . import views
  from django.conf import settings
  from django.conf.urls.static import static
  urlpatterns = [
      path('', views.home, name='home-page'),
      path('about/', views.about_us, name='about'),
      path('signup/', views.signup, name='signup'),
      path('submit_your_task/', views.submit_your_task, name='submit_your_task'),
  ]
  
  if settings.DEBUG:
      urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
  
  </code></pre>
  
  <p>And when I put the slash after 'submit_your_task' it gives me RuntimeError</p>
  
  <pre><code>RuntimeError at /submit_your_task
  
  You called this URL via POST, but the URL doesn't end in a slash and you have APPEND_SLASH set. Django can't redirect to the slash URL while maintaining POST data. Change your form to point to 127.0.0.1:8000/submit_your_task/ (note the trailing slash), or set APPEND_SLASH=False in your Django settings.
  
  Request Method:     POST
  Request URL:    http://127.0.0.1:8000/submit_your_task
  Django Version:     2.2.4
  Exception Type:     RuntimeError
  Exception Value:    
  
  You called this URL via POST, but the URL doesn't end in a slash and you have APPEND_SLASH set. Django can't redirect to the slash URL while maintaining POST data. Change your form to point to 127.0.0.1:8000/submit_your_task/ (note the trailing slash), or set APPEND_SLASH=False in your Django settings.
  
  </code></pre>