A validator is code that checks whether a value meets specified criteria. When the value fails, the validator raises a ValidationError. Django supplies built-in validators and lets you attach them to fields or write your own. section 14.1
Password validation is configured through AUTH_PASSWORD_VALIDATORS, a list of validator settings. Django’s defaults check username similarity, minimum length, common passwords, and whether the password contains a number. section 9.1.2
A validator can be used in several practical ways:
- Use Django’s built-in validators for common rules such as password length and common-password detection. section 9.1.2
- Attach a specific validator to a model field; some model fields are character fields with a validator already attached. section 14.1
- Write a custom validator and register it in AUTH_PASSWORD_VALIDATORS when the built-in rules are not enough. section 9.1.2
Changing a password from the command line
Run `python manage.py changepassword nicky`, enter the new password twice, and Django reports success only after applying the current password-security rules. Unlike createsuperuser, changepassword does not offer a way to bypass password validation. section 9.1.2
(venv) RiffMates$ python manage.py changepassword nicky Changing password for user 'nicky' Password: Password (again): Password changed successfully for user 'nicky'
The command transcript shows the input-and-confirmation flow and the resulting success message. section 9.1.2

