I need to override default form for error messages and the way I am doing it is like below:
default_error_list = {
'required': 'error message 1',
'invalid': 'error message 2'
}
class JoinForm(forms.Form):
username = forms.CharField(error_messages=default_error_list)
Can someone tell me where I can find all possible keys of errors: (required, invalid, etc.)
In the official Django documentation for the built-in fields there is a section exactly for what you are asking here
For your above example is:
CharField
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With