1👍
✅
As far as I know, it simply doesn’t. Those are only used across forms and the django admin interface.
I always specify those things on the serializer level, by setting the appropiate arguments for my fields (doc), in this case it would be allow_blank
.
I am building REST APIs with django, and the only case where the blank
property on the model field catches me, is when fiddling around on the admin page.
However, there appears to be a package that could be of interest to you:
django-seriously.
I haven’t used it, but it appears to call full_clean()
on every save()
.
Of course, this has the disadvantage that you will probably loose DRFs nice error messages.
Source:stackexchange.com