Could we maybe add this line to clarify/document further?

    assert isinstance(request.POST['file'], cgi.FieldStorage)