I want to create password as password field in views.
models.py:
class User(models.Model):
username = models.CharField(max_length=100)
password = models.CharField(max_length=50)
forms.py:
class UserForm(ModelForm):
class Meta:
model = User
Use widget as PasswordInput
from django import forms
class UserForm(forms.ModelForm):
password = forms.CharField(widget=forms.PasswordInput)
class Meta:
model = User