There is a form. It has a field for uploading a file. I submit this form and send it to server by ajax request, post method. 
var frm = $('#contact_form');
frm.submit(function (e) {
    e.preventDefault();
    var data = new FormData()
    data.append('file', $('#id_file')[0].files[0]);
    $.ajax({
        beforeSend: function(jqXHR, settings) {
            jqXHR.setRequestHeader('X-CSRFToken', $('input[name=csrfmiddlewaretoken]').val());
        },
        type: frm.attr('method'),
        method: 'POST',
        url: '',
        data: data,
        cache: false,
        contentType: false,
        processData: false,
        success: function(data) {
            console.log(data)
        }
    });
    return false;
});
I'm use the formdata. I look at the client - there is data. But they do not come to the server (request.POST={}). What could be the reason?
def post(self, request, *args, **kwargs):
    print(request.GET, request.FILES, request.POST)
    contact_form = ContactFormForm(request.POST, request.FILES)
    if contact_form.is_valid():
        contact_form = contact_form.save()
        file = request.build_absolute_uri('/')[:-1] + settings.MEDIA_URL + str(contact_form.file)
        return JsonResponse({})
    else:
        response = {}
        for k in contact_form.errors:
            response[k] = contact_form.errors[k][0]
        return JsonResponse({'response': response, 'result': 'error'})
Headers
Accept: */*
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9,ru;q=0.8
Connection: keep-alive
Content-Length: 217843
Content-Type: false
Cookie: csrftoken=xEVnU5IVNTff6r2gft5Sn1wjf9bB0N5UAXrZ1lEsBUCeAlZZwnRBSKVbBEqirQ2K
Host: 127.0.0.1:8002
Origin: http://127.0.0.1:8002
Referer: http://127.0.0.1:8002/contacts/
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36
X-CSRFToken: MKW45AcnL9digoNWyJ4gi4pb2LVMxbBDP3sGcQ8UzaAhKiKFPDQZNNO3ogatYeyt
X-Requested-With: XMLHttpRequest
Body
------WebKitFormBoundaryALIAgAcqetpuKz4M
Content-Disposition: form-data; name="file"; filename="Screenshot from 2019-08-05 12-02-45.png"
Content-Type: image/png
------WebKitFormBoundaryALIAgAcqetpuKz4M--
