File upload with Django: Invalid form
问题 First time posting a question. I've basically copied everything I've found on here and on the django documentation site and I can't figure out what I'm doing incorrectly Here is the code from my views.py file from django import forms class UploadFileForm(forms.Form): title = forms.CharField(max_length=50) file = forms.FileField() def upload_file(request): form = UploadFileForm(request.POST, request.FILES) if form.is_valid(): response = "Form is valid." else: response = "Failed to upload