python版本和django版本不對應(yīng)的問題,python3中沒有decode方法,但是django還在用,因此造成了錯誤。在另一個環(huán)境中,用的python3.7+django3,就沒有同樣的錯誤。 解決方法:打開debug.py,在第331行的open()中,加上 encoding="utf-8" 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 即可解決此問題
2023-05-07
python版本和django版本不對應(yīng)的問題,python3中沒有decode方法,但是django還在用,因此造成了錯誤。在另一個環(huán)境中,用的python3.7+django3,就沒有同樣的錯誤。
解決方法:打開debug.py,在第331行的open()中,加上 encoding="utf-8"
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
即可解決此問題