How to check why form is not valid
I have some troublesome form in my django app. Problem is that it doesn't validate. How can I check what is causing the problem ? I've tried the following :
form.data = {dictionary_with_data}
form.is_valid()
False
form._errors
{}
form.errors
开发者_如何学Python{}
Form.non_field_errors()
[]
Try this
form = YourForm(data={dict_with_data})
精彩评论