widgets = {
'img':forms.ImageInput(attrs={'class':'box'}),
'title':forms.TextInput(attrs={'class':'box'}),
'title':forms.TextInput(attrs={'class':'box'}),
'title':forms.TextInput(attrs={'class':'box'}),
}
'img':forms.ImageInput(attrs={'class':'box'}), this line gives me error.
CodePudding user response:
The widget for ImageField
is FileInput
not ImageInput, django has no widget called ImageInput...
Try this code
'img':forms.FileInput(attrs={'class': 'box'}),