python
睡觉的狐狸
这个作者很懒,什么都没留下…
展开
-
UnicodeDecodeError gbk codec cant decode byte in position 9737
这是个编码问题,解决方法如下文件路径 \Lib\site-packages\django\views\debug.py这里注意是你使用的环境,我这里使用的是python虚拟环境,所以需要改项目中的文件,之后重启服务生效将322行with Path(CURRENT_DIR, 'templates', 'technical_500.html').open() as fh:改为with Path(CURRENT_DIR, 'templates', 'technical_500.html').op原创 2020-05-19 13:49:06 · 283 阅读 · 0 评论 -
获取django models.py中表的名称,和别名
[x.column for x in cmdb.models.Host._meta.fields]原创 2019-12-31 11:19:52 · 900 阅读 · 0 评论