title: How to append error message to form.non_field_errors in django?
body: <p>I have a form with several fields. I have separate validation checks for each field, done via the forms validation. I however also need to check if few fields are filled in before redirecting the user to a different view. I was hoping I could somehow append the error to forms.non_field_errors as it is not for a particular field , but I am not sure what the right syntax for this would be. I have checked online and found..</p>
  
  <pre><code>form.errors['__all__'] = form.error_class(["error msg"])
  </code></pre>
  
  <p>This displays the error message, but it seems to mess up the other pages as well and displyas the error message if I click on anything else. </p>
  
  <p>I tried </p>
  
  <pre><code>form._errors[NON_FIELD_ERRORS] = form.error_class()
  </code></pre>
  
  <p>This causes a 'NoneType' object has no attribute 'setdefault' error for me.</p>
  
  <p>I have tried   </p>
  
  <pre><code>form.non_field_errors().append("Please complete your profile in order to access the content.")
  </code></pre>
  
  <p>This doesn't seem to do anything and I cant see the error message on the view.</p>
  
  <p>What would be the best way to do this? Ideally I dont' want to do it in the form's clean method. I feel like I should be able to append an error to the form in the view. </p>