class PlaceholderDemoForm(forms.ModelForm):

    def __init__(self, *args, **kwargs):
        super(PlaceholderDemoForm, self).__init__(*args, **kwargs)
for field_name in self.fields:
    field = self.fields.get(field_name)
if field:
    if type(field.widget) in (forms.TextInput, forms.DateInput):
        field.widget = forms.TextInput(attrs={'placeholder': field.label})


class Meta:
    pass
How do I add a placeholder on a CharField in Django?