  
  class HTMLFormRenderer(BaseRenderer):
      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
  
 
</s> remove         for k, v in serializer.get_fields().items():
            if getattr(v, 'read_only', True):
 </s> add         for key, val in data.fields.items():
            if getattr(val, 'read_only', True): </s> remove             kwargs['required'] = v.required
 </s> add             kwargs['required'] = val.required </s> remove         context = RequestContext(request, {'form': form_instance})
 </s> add         context = RequestContext(request, {'form': DynamicForm(data)}) </s> remove             fields[k] = v.form_field_class(**kwargs)
 </s> add             fields[key] = val.form_field_class(**kwargs)
    def data_to_form_fields(self, data):
  
  class HTMLFormRenderer(BaseRenderer):
      template = 'rest_framework/form.html'
  
    def data_to_form_fields(self, data):
          fields = {}
          for k, v in serializer.get_fields().items():
              if getattr(v, 'read_only', True):
                  continue
  
keep keep keep keep replace keep keep keep keep keep
 Cleanup and dealing with empty form data. 
rest_framework/renderers.py