Take this very simple form for example:
class SearchForm(Form):
q = forms.CharField(label=\'search\')
This gets rendered in the templat
The other methods are all good. However, if you prefer to not specify the field (e.g. for some dynamic method), you can use this:
def __init__(self, *args, **kwargs):
super(MyForm, self).__init__(*args, **kwargs)
self.fields['email'].widget.attrs['placeholder'] = self.fields['email'].label or 'email@address.nl'
It also allows the placeholder to depend on the instance for ModelForms with instance specified.