def file_upload_echo_content(request):
def read_and_close(f):<EOL><INDENT>with f:<EOL><INDENT>return f.read().decode()<EOL><DEDENT><DEDENT>r = {k: read_and_close(f) for k, f in request.FILES.items()}<EOL>return JsonResponse(r)<EOL>
Simple view to echo back the content of uploaded files for tests.