forms.Form
forms
forms.py
ModelForm
class UploadImageForm(forms.ModelForm): """ 定义用户上传图片的form """ class Meta: model = UserProfileModel fields = ['image']