You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[DJ01] Avoid using null=True on string based fields such as CharField and TextField
Rocio Aramberri edited this page Jan 19, 2021
·
4 revisions
It is considered a bad practice to allow NULL values in a string-based field. By allowing null values on a string-based field there would be two values that would indicate no data: NULL or empty string. To avoid redundancy, the Django convention is to use an empty string.
There is an exception for this rule when unique=True and blank=True since an empty string value would not be unique.