      template = 'rest_framework/form.html'
  
      def serializer_to_form_fields(self, serializer):
          fields = {}
          for k, v in serializer.get_fields().items():
              if getattr(v, 'read_only', True):
                  continue
  
              kwargs = {}
              kwargs['required'] = v.required
  
 
</s> remove     def serializer_to_form_fields(self, serializer):
 </s> add     def data_to_form_fields(self, data): </s> remove             kwargs['required'] = v.required
 </s> add             kwargs['required'] = val.required </s> remove     def render(self, serializer, obj, request):
        fields = self.serializer_to_form_fields(serializer)
 </s> add     def render(self, data, accepted_media_type=None, renderer_context=None):
        self.renderer_context = renderer_context or {}
        request = renderer_context['request'] </s> remove             fields[k] = v.form_field_class(**kwargs)
 </s> add             fields[key] = val.form_field_class(**kwargs)
        for key, val in data.fields.items():
            if getattr(val, 'read_only', True):
      template = 'rest_framework/form.html'
  
      def serializer_to_form_fields(self, serializer):
          fields = {}
        for key, val in data.fields.items():
            if getattr(val, 'read_only', True):
        for key, val in data.fields.items():
            if getattr(val, 'read_only', True):
                  continue
  
              kwargs = {}
              kwargs['required'] = v.required
  
keep keep keep keep replace replace keep keep keep keep keep
 Cleanup and dealing with empty form data. 
rest_framework/renderers.py