'ascii' codec can't decode byte 0xe4 in position 0: ordinal not in range(128)

用django写东西,出现的这个错误

解决办法:

在search.py文件中添加

    

import sys

reload(sys)

sys.setdefaultencoding('utf-8')


问题就解决了~

猜你喜欢

转载自blog.csdn.net/qq_38698632/article/details/79806087