code: def serialize(self, content):
          
          if self.response.error:
              template_name = op.join('api', 'error.%s' % self.format)
          else:
              template_name = (self.resource._meta.emit_template
                               or self.get_template_path(content))
  
          template = loader.get_template(template_name)
  
          return template.render(RequestContext(self.request, dict(
              content=content,
              emitter=self,
              resource=self.resource)))
docs: Render Django template.
  
          :return string: rendered content