title: Django won't upload and save document
body: <p>Can you see is there any problem? I don't have any errors, everything is showing but when I upload document, nothing happens, document is not uploaded. Everything seems as it should be, but something I missed, why won't upload document?</p>
  <p>my_app/forms.py</p>
  <pre><code>class UploadFileForm(forms.Form):
      file = forms.FileField()
  </code></pre>
  <p>my_app/hendle_file.py</p>
  <pre><code>def handle_uploaded_file(f):  
      with open('my_app/static/upload/'+f.name, 'wb+') as destination:  
          for chunk in f.chunks():  
              destination.write(chunk)  
  </code></pre>
  <p>my_app/views.py</p>
  <pre><code>from .forms import UploadFileForm
  from .handle_file import handle_uploaded_file
  def upload_file(request):
      form = UploadFileForm()
      if request.method == 'POST':
          form = UploadFileForm(request.POST, request.FILES)
          if form.is_valid():
              print(form.cleaned_data)
              handle_uploaded_file(request.FILES['file'])
              return HttpResponseRedirect('file uploaded')
      else:
          form = UploadFileForm()
      return render(request, 'my_app/uploadfile.html', {'form': form})
  </code></pre>
  <p>my_app/template/my_app/uploadfile.html</p>
  <pre><code>{% extends &quot;my_app/base.html&quot; %}
  {% block content %}
  
        &lt;form method=&quot;post&quot; enctype=&quot;multipart/form-data&quot;&gt;
           {% csrf_token %}
           &lt;h1&gt;Upload your document!&lt;/h1&gt;
           {{ form.as_p }}
           &lt;input type=&quot;submit&quot; type=&quot;button&quot; value=&quot;Upload&quot;
        &lt;/form&gt;
  {% endblock content %}
  </code></pre>