Raise a validation error in a model’s save method in Django

Most Django views e.g. the Django admin will not be able to handle a validation error in the save method, so your users will get 500 errors.

You should do validation on the model form or on the model, and raise ValidationError there. Then call save() only if the model form data is ‘good enough to save’.

Leave a Comment