Django - 网页加载报错:A server error occurred. Please contact the administrator
2020-04-23 09:10
706 查看
1.网页加载时报错显示:
2.pycharm中Terminal报错显示:
如: File “E:\flask_env\django_env\lib\site-packages\django\views\debug.py”, line 332, in get_trace
back_html
t = DEBUG_ENGINE.from_string(fh.read())
UnicodeDecodeError: ‘gbk’ codec can’t decode byte 0xa6 in position 9737: illegal multibyte seque
nce
3.解决方法:
打开你上述报错文件位置:E:\flask_env\django_env\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
就成功了。
- 点赞
- 收藏
- 分享
- 文章举报
相关文章推荐
- python Django错误解决:A server error occurred. Please contact the administrator.
- 网站出现An error occurred on the server when processing the URL. Please contact the system administrator
- 解决方法:An error occurred on the server when processing the URL. Please contact the system administrator
- 解决方法:An error occurred on the server when processing the URL. Please contact the system administrator
- 解决方法:An error occurred on the server when processing the URL. Please contact the system administrator
- 解决IIS7运行ASP提示错误:An error occurred on the server when processing the URL. Please contact the system administrator
- 解决IIS7运行ASP提示错误:An error occurred on the server when processing the URL. Please contact the system administrator
- An error occurred on the server when processing the URL. Please contact the system administrator
- An error occurred on the server when processing the URL. Please contact the system administrator.
- 解决IIS7运行ASP提示错误:An error occurred on the server when processing the URL. Please contact the system administrator
- 解决IIS7运行ASP提示错误:An error occurred on the server when processing the URL. Please contact the system administrator
- IIS7.0 调试ASP程序时候,程序有错误只提示"An error occurred on the server when processing the URL.Please contact the system administrator",看不到详细的提示的解决办法
- IIs 中运行asp程序出现“An error occurred on the server when processing the URL. Please contact the system administrator.”错误
- 解决方法:An error occurred on the server when processing the URL. Please contact the system administrator
- An error occurred on the server when processing the URL. Please contact the system administrator
- 解决方法:An error occurred on the server when processing the URL. Please contact the system administrato
- 解决方法:An error occurred on the server when processing the URL. Please contact the system administrato
- 如何以管理员身份运行cmd及解决方法:An error occurred on the server when processing the URL. Please contact the syste
- 解决方法:An error occurred on the server when processing the URL. Please contact the system administrato
- 解决方法:An error occurred on the server when processing the URL. Please contact the system administrato