          if not model_field.editable:
              kwargs['read_only'] = True
              kwargs.pop('queryset', None)
          if kwargs.get('read_only', False):
              # If this field is read-only, then return early.
              # No further keyword arguments are valid.
              return kwargs
  
 
</s> remove         if model_field.null:
            kwargs['allow_null'] = True
 </s> add  </s> remove     if model_field.null:
        kwargs['allow_null'] = True

 </s> add 
        if model_field.null:
            kwargs['allow_null'] = True
          if not model_field.editable:
              kwargs['read_only'] = True
              kwargs.pop('queryset', None)
        if model_field.null:
            kwargs['allow_null'] = True
          if kwargs.get('read_only', False):
              # If this field is read-only, then return early.
              # No further keyword arguments are valid.
              return kwargs
  
keep keep add keep keep keep keep keep
 Make autogenerated read only fields to be able to be nullable (#8536) 
rest_framework/utils/field_mapping.py