Hi I am using the django model class with some field and a password field. Instead of displaying regular plain text I want to display password input. I created a model class
I did as a follow without any extra import
from django import forms
class Loginform(forms.Form):
attrs = {
"type": "password"
}
password = forms.CharField(widget=forms.TextInput(attrs=attrs))
The idea comes form source code: https://docs.djangoproject.com/en/2.0/_modules/django/forms/fields/#CharField