visual-studio-code - VS coed中python django语法报错问题
黄舟
黄舟 2017-04-18 10:16:52
0
2
942


pylint红线是报错
不知是vs code的问题 还是代码的问题
另外代码应该是没问题
不知道怎么解决

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(2)
左手右手慢动作

Install pylint-django

https://github.com/landscapei...
Prevents warnings about Django-generated attributes such as Model.objects or Views.request.

I am sorting out the documents for developing Django projects using vscode, waiting for my update

  1. Press Ctrl + Shift + P in vscode, enter workspace, select Preferences: Open Workspace Settings, the JSON file after the configuration is completed is as follows
    {

"python.pythonPath": "e:/temp/django_demo/env/scripts/python.exe",
"python.linting.pylintPath": "pylint",
"python.linting.pylintArgs": [
    "--load-plugins", "pylint_django"

],
"python.formatting.autopep8Path": "autopep8"

}

伊谢尔伦

The reason for the warning is the use of tabs. The reason for the error should be that there is some problem with the design of the models.Article class. Otherwise, Artilce.objects.all()an error is unlikely to occur. The questioner posted the code (including models.py) to have a look (put it in pre).

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template