CSRF error in Django after removal of hidden fields
问题 I got some good advice on StackOverflow about how to remove all hidden fields using JavaScript. Submitting the form sends the user to /submit , calling the submit_form view. In my views.py file, I define my index page (with the form), and the page that receives the submission (my /index page prints errors for me, but that shouldn't influence anything): def index(request, error_message = ''): t = get_template('index.html') html = t.render(Context( { 'ERROR_MESSAGE': error_message } )) return