[Fixed]-Django 1.8 model field permits blank but is required

1👍

I think you need to clearly understand the difference between :
null = True and blank = True.

null = true, is used when the value of a particular field is optional.
blank = true, is used when the value of the field is to be rendered as ‘required’ field while using it in forms.

They are together used for certain fields to ensure that, the particular field’s value is optional. So here, instead of using blank=True, enforce null=True to make the value for first_name optional.

0👍

Aha, the form field should be flagged with required=False. I’ve updated the question to show the corrected line in full.

reference

👤jma

Leave a comment