[Fixed]-Django CharField without empty strings

5👍

According to the documentation, blank=False is purely validation-related that works only on a form level.

See related threads:

👤alecxe

27👍

Use a MinLengthValidator:

from django.core.validators import MinLengthValidator
...
title = models.CharField(max_length=10, validators=[MinLengthValidator(1)])

Leave a comment