UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128

写django报如下错误:

  File "C:\Python27\MyDjango\jianzhi_002\jianzhi_app\models.py", line 391, in __unicode__
    return str(self.score_goods_name)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1:
 ordinal not in range(128)

将原来的


def __unicode__ (self):
    return str(self.job_name)

改为

def __unicode__ (self):
    return self.job_name

问题解决。

你可能感兴趣的:(日常报错解决)