Django form returns form.is_valid False
<p>This must be kind of basic issue but I am very new in Djnago and trying to learn how the forms work. I have looked in different sites and forums but I haven't managed to understand what I am doing wrong.</p>

<p>This is my form:</p>

<pre><code>class UploadCSVForm(forms.Form):
   csv_file = forms.FileField()
</code></pre>

<p>Its a very simple form used in order to upload a CSV file.</p>

<p>This is what I have in my view:</p>

<pre><code>def layer_create(request, template='layers/layer_create.html'):
  if request.method == 'POST':

    form = UploadCSVForm(request.POST, request.FILES)
    #print form.is_bound  # THIS PRINTS TRUE
    #print (request.FILES['csv']) # THIS PRINTS THE FILE IN THE MEMORY

    if form.is_valid():
        print ("valid")
    else:
        print ("not valid")
        out = {'success': False}

    return HttpResponse('test site')
</code></pre>

<p>And this is the form in my Template:</p>

<pre><code>&lt;form id="file-uploader" method="post" enctype="multipart/form-data" action="{% url "layer_create" %}"&gt;
      &lt;input type="hidden" name="csrfmiddlewaretoken" value="{{ csrf_token }}"&gt;
      &lt;input type="file" id="file-input" name="csv" /&gt;
      &lt;button type="submit" id="upload-button" class="btn btn-danger"&gt;Upload&lt;/button&gt;
&lt;/form&gt;
</code></pre>

<p>Using the function <code>is_bound</code> I see that there are actual data bound on the form.
And when I print: <code>request.FILES['csv']</code> I can see the name of the file uploaded in the Memory.</p>

<p>But I still get <code>form.is_valid = False</code> without ant errors or warnings.</p>