How to use more than one widget in a Django field?

django, forms, python, widget

Solution

`PasswordInput` accepts `attrs` as well.

login_password = forms.CharField(label=u'password', widget=forms.PasswordInput(render_value=False, attrs={'placeholder': 'password'}))

Problem

I have a specific field in a form which needs to have a custom attribute AND we styled as a password box. Currently I have: ``` login_password = forms.CharField(label=(u'password')) ``` But I need both of these: ``` widget=forms.TextInput(attrs={'placeholder': 'password'}) widget=forms.PasswordInput(render_value=False) ``` How can I make it so the field uses these two widgets? I've read about `MultiWidget` but I'm not sure if this is what I need to use or how exactly to use it.

Original source