访问admin出现UnicodeDecodeError: ‘gbk’ codec can’t decode byte 0xa6 in position 9737: illegal multibyte sequence
ERROR basehttp 154 “POST /admin/login/?next=/admin/ HTTP/1.1” 500 59
解决方案
打开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
就成功了。
这个目录
修改为: