Class has no objects member
Solution 1:
Install pylint-django
using pip
as follows
pip install pylint-django
Then in Visual Studio Code goto: User Settings (Ctrl + , or File > Preferences > Settings if available ) Put in the following (please note the curly braces which are required for custom user settings in VSC):
{"python.linting.pylintArgs": [
"--load-plugins=pylint_django"
],}
Solution 2:
@tieuminh2510's answer is perfect. But in newer versions of VSC you will not find the option to edit or paste that command in User Settings
.
For newer versions, add the code in the following steps:
- Press ctrl shift p to open the the Command Palette.
- Now in Command Palette type
Preferences: Configure Language Specific Settings
. - Select
Python
. - Add these lines inside the first curly braces:
"python.linting.pylintArgs": [
"--load-plugins=pylint_django",
]
Make sure that
pylint-django
is also installed.