          fields = self.serializer_to_form_fields(serializer)
  
          # Creating an on the fly form see:
          # http://stackoverflow.com/questions/3915024/dynamically-creating-classes-python
          OnTheFlyForm = type(str("OnTheFlyForm"), (forms.Form,), fields)
          data = (obj is not None) and serializer.data or None
          form_instance = OnTheFlyForm(data)
  
          template = loader.get_template(self.template)
          context = RequestContext(request, {'form': form_instance})
  
          return template.render(context)
 
</s> remove         context = RequestContext(request, {'form': form_instance})
 </s> add         context = RequestContext(request, {'form': DynamicForm(data)}) </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) </s> remove     def _get_form(self, view, method, request):
        # We need to impersonate a request with the correct method,
        # so that eg. any dynamic get_serializer_class methods return the
        # correct form for each method.
        restore = view.request
        request = clone_request(request, method)
        view.request = request
        try:
            return self.get_form(view, method, request)
        finally:
            view.request = restore

    def _get_raw_data_form(self, view, method, request, media_types):
 </s> add     def _get_rendered_html_form(self, view, method, request):
        fields = self.data_to_form_fields(data)
        DynamicForm = type(str('DynamicForm'), (forms.Form,), fields)
        data = None if data.empty else data
          fields = self.serializer_to_form_fields(serializer)
  
          # Creating an on the fly form see:
          # http://stackoverflow.com/questions/3915024/dynamically-creating-classes-python
        fields = self.data_to_form_fields(data)
        DynamicForm = type(str('DynamicForm'), (forms.Form,), fields)
        data = None if data.empty else data
        fields = self.data_to_form_fields(data)
        DynamicForm = type(str('DynamicForm'), (forms.Form,), fields)
        data = None if data.empty else data
        fields = self.data_to_form_fields(data)
        DynamicForm = type(str('DynamicForm'), (forms.Form,), fields)
        data = None if data.empty else data
  
          template = loader.get_template(self.template)
          context = RequestContext(request, {'form': form_instance})
  
          return template.render(context)
keep keep keep keep replace replace replace keep keep keep keep keep
 Cleanup and dealing with empty form data. 
rest_framework/renderers.py