Guest User

Untitled

a guest
Aug 7th, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. How can I get password text box for django?
  2. class Users(models.Model):
  3. username = models.CharField(max_length=255)
  4. password = models.CharField(max_length=300)
  5. password_token = models.CharField(max_length=300, default='0')
  6.  
  7. from django.forms import ModelForm, PasswordInput
  8. class UserForm(ModelForm):
  9.  
  10. class Meta:
  11. model = Users
  12.  
  13. widgets = {
  14. 'password' : PasswordInput(),
  15. }
  16.  
  17. from django import forms
  18. from models import Users
  19.  
  20. class UsersForm(forms.ModelForm):
  21. password = forms.CharField(widget=forms.PasswordInput)
  22.  
  23. class Meta:
  24. model = Users
Add Comment
Please, Sign In to add comment