VS Code Django解决不必要报错

一、解决不必要的django语法报错

报错示例:

安装配置pylint-django插件解决。

1.1 下载插件

在命令行执行:

pip install pylint-django

1.2 配置插件

VS Code中,File >> Preferences >> Settings 中:
找到Python > Linting:Pylint Args选项,
添加参数:

--load-plugins=pylint_django
# 如想设置error级别,可添加:
--errors-only

保存即可,如不生效可重启再行查看。

二、左侧文件目录缩进不明显

在File >> Preferences >> Settings 中:
搜索:TreeIndent
将其缩进像素加大即可:

原文地址:https://www.cnblogs.com/amnotgcs/p/13786501.html