These base form classes add a method to return error messages as HTML encoded as JSON from Django, optionally passing in an argument to strip tags out. The method can be called in your view after checking that your form is valid. There is a ModelForm and Form class to use depending on your needs.
The sample jQuery function will take the errors returned as json, loop over the errors and insert the error after each field. If you're using a form prefix, you'll need to add a hidden field to hold the value for the prefix.
The `__all__` error(s), which are not bound to a field are appended to the end of the form, which you could easily reposition.
Happy coding!