Skip to content

Instantly share code, notes, and snippets.


Robert Flaugher flaugher

  • Los Angeles, CA, USA
View GitHub Profile
flaugher / gist:ec36ec940a31707ac683
Created Mar 1, 2015
Things to do if your Django form.is_valid() method fails
View gist:ec36ec940a31707ac683
- Check that you inserted "request.POST" as an argument to your form when instantiating the form in your view after the POST.
- Add {{ form.errors }} {{ form.non_field_errors }} to the form or debug your view and print them from the debugger.
- Examine each form field in the debugger: myform['<fieldname>'].value()
- Make sure DEBUG = True so that you'll see any server errors.
- Check your server log.
- If all else fails, step through the is_valid() call.