在类似于
C:\Development\Anaconda3\envs\gather\Lib\site-packages\django\views\debug.py
这个目录 找到debug文件,修改里面
// An highlighted block
def get_traceback_html(self):
"""Return HTML version of debug 500 HTTP error page."""
with Path(CURRENT_DIR, 'templates', 'technical_500.html').open(encoding='UTF-8') as fh:
t = DEBUG_ENGINE.from_string(fh.read())
c = Context(self.get_traceback_data(), use_l10n=False)
return t.render(c)
源代码open里面没有设置编码,把编码设置上就行了