          fields = self.get_fields(instance)
  
          # serialize each required field 
          for fname in fields:
              if hasattr(self, fname):
                  # check for a method 'fname' on self first
                  meth = getattr(self, fname)
                  if inspect.ismethod(meth) and len(inspect.getargspec(meth)[0]) == 2:
                      obj = meth(instance)
              elif hasattr(instance, fname):
 
</s> remove             elif hasattr(instance, fname):
 </s> add             elif hasattr(instance, smart_str(fname)): </s> remove         return getattr(self.rename, key, key)
 </s> add         return getattr(self.rename, smart_str(key), smart_str(key)) </s> remove     source ./env/bin/activate
 </s> add     source env/bin/activate </s> remove from django.utils.encoding import smart_unicode, is_protected_type
 </s> add from django.utils.encoding import smart_unicode, is_protected_type, smart_str
            if hasattr(self, smart_str(fname)):
          fields = self.get_fields(instance)
  
          # serialize each required field 
          for fname in fields:
            if hasattr(self, smart_str(fname)):
                  # check for a method 'fname' on self first
                  meth = getattr(self, fname)
                  if inspect.ismethod(meth) and len(inspect.getargspec(meth)[0]) == 2:
                      obj = meth(instance)
              elif hasattr(instance, fname):
keep keep keep keep replace keep keep keep keep keep
 Fix bitbucket issue 39.  All further issues should be on github 
djangorestframework/serializer.py