I have a django model that I\'m displaying as a form using a ModelForm. The defaults work very well for me for the most part.
However, I would like my html
Slight change to @josh-smeaton 's answer.
class AuthorForm(ModelForm): class Meta: model = Author widgets = { 'name': forms.TextInput(attrs={'placeholder': 'name'}), }
Without the "forms." in front of TextInput a NameError would be raised.
Django Ver 2.0.1