1👍
If you are using a FormHelper
, you can set attrs
(docs).
For example to set autocomplete="off"
as in the answer you linked to, you would do:
class ExampleForm(forms.Form):
def __init__(self, *args, **kwargs):
super(ExampleForm, self).__init__(*args, **kwargs)
self.helper = FormHelper(self)
self.helper.attrs = {'autocomplete': 'off'}
Source:stackexchange.com