1、報錯:
UnicodeDecodeError: 'gbk' codec can't decode byte 0xa6 in position 9737: illegal multibyte sequence
2、解決:
打開django/views下的debug.py文件,轉到line331行:
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
就成功了。
如果用的是虛擬環境,就你要到自己的虛擬環境中,修改django包。