你需要传递RequestContextrender_to_responsecsrf_token
为此:(views.py)
from django.template import RequestContext
...
return render_to_response('fileupload/upload.html', {'form': c['UploadFileForm']}, RequestContext(request))
# Added RequestContext
这会将csrf的令牌传递到模板。