Django2.2报错合集

2019-11-06  本文已影响0人  aport
UnicodeDecodeError: 'gbk' codec can't decode byte 0xa6 in position 9737: illegal multibyte sequence

解决方案:

打开\Lib\site-packages\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

就成功了。
上一篇 下一篇

猜你喜欢

热点阅读