Zishan Ahmad's Blog

Zishan Ahmad's Blog

Using Django Model Validations in Django Rest Framework

Mar 6, 20216 min read

While coding models in Django, we generally add validations for that model in the clean method. This helps us in making sure our model does not store invalid data. Let's try to understand this through code: # core/models.py from django.core.exception...