Question

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?

Was it helpful?

Solution

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))
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top