diff --git a/rest_framework/fields.py b/rest_framework/fields.py index 43fed9aee..48cd74513 100644 --- a/rest_framework/fields.py +++ b/rest_framework/fields.py @@ -311,6 +311,10 @@ class Field(object): self._creation_counter = Field._creation_counter Field._creation_counter += 1 + # If `default` is unset, then use `None` when allow_null is `True`. + if default is empty and allow_null: + default = None + # If `required` is unset, then use `True` unless a default is provided. if required is None: required = default is empty and not read_only