Issues regarding field types in Django

后端 未结 2 1757
长情又很酷
长情又很酷 2021-01-25 11:57

I am new to Django and I want to make a user registration form in Django. While creating model, I gave a fieldtype->PasswordField() to password field but when I run this model i

2条回答
  •  北恋
    北恋 (楼主)
    2021-01-25 12:34

    There is no PasswordField() in django. You can to use CharField() to store a password, but to show it as password input type in a html form you can specify a widget to it.

    Example:

    password = forms.CharField(widget=forms.PasswordInput())
    

    More reference at :PasswordInput

提交回复
热议问题