Django报错解决方案收集

UnicodeDecodeError: 'gbk' codec can't decode byte 0xa6 in position 9737: illegal multibyte sequence

报这个错的原因应该是debug.py文件中的编码问题,具体解决方式:
打开django/views下的debug.py文件,331行:

with Path(CURRENT_DIR, 'templates', 'technical_500.html').open() as fh
改成:
with Path(CURRENT_DIR, 'templates', 'technical_500.html').open(encoding="utf-8") as fh
应该就可以了

转载:https://blog.csdn.net/yixiaotian1993/article/details/89190213

 

posted @ 2020-07-29 17:39  布谷鸟的春天  阅读(118)  评论(0编辑  收藏  举报