  def get_relation_kwargs(field_name, relation_info):
      """
      Creates a default instance of a flat relational field.
      """
      model_field, related_model, to_many, has_through_model = relation_info
      kwargs = {
          'queryset': related_model._default_manager,
          'view_name': get_detail_view_name(related_model)
      }
  
 
</s>
    model_field, related_model, to_many, to_field, has_through_model = relation_info
  def get_relation_kwargs(field_name, relation_info):
      """
      Creates a default instance of a flat relational field.
      """
    model_field, related_model, to_many, to_field, has_through_model = relation_info
      kwargs = {
          'queryset': related_model._default_manager,
          'view_name': get_detail_view_name(related_model)
      }
  
keep keep keep keep replace keep keep keep keep keep
 Added support for the to_field on ForeignKey fields
rest_framework/utils/field_mapping.py