修改对 django 项目中的错误语法提示
- 安装 pylint-django 的 Python 包
- 在 settings.json 中添加如下配置
1
2
3
4"python.linting.pylintArgs": [
"--load-plugins",
"pylint_django"
],
原因是
1 | It is nice for a Python module to have a docstring, explaining what the module does, what it provides, examples of how to use the classes. This is different from the comments that you often see at the beginning of a file giving the copyright and license information, which IMO should not go in the docstring (some even argue that they should disappear altogether, see eg. |
原因是
1 | As your code is not contained in a class or function it is expecting those variables to be constants and as such they should be uppercase. |