문제

I'm using django.contrib.auth.views.login to log in users. When login is failed, the user and password fields get posted back to the form.

What's the proper way to clean those?

도움이 되었습니까?

해결책

Pass render_value=False when you create your password field's PasswordInput widget.

class YourAuthenticationForm(AuthenticationForm):
    password = forms.CharField(widget=forms.PasswordInput(render_value=False))
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top