Django/Visual Studio Tutorial - objects method error

That is not error, just a warning from the Visual Studio Code. objects is a Manager instance which is added to our model classes dynamically by django. When VS Code checks the class declaration, it do not found objects declaration there, so warns us about a possible error.

In, Visual Studio code, python extension uses pylint as default linter.

To work it properly you can install pylint locally as:

pip install pylint

Or, you can also disable linting by configuring the following property in either one of (User or Workspace settings file) as follows:

"python.linting.enabled": false

For django projects, you can customize the pylint plugin by modifying the User or Workspace settings as follows:

"python.linting.pylintArgs": ["--load-plugins", "pylint_django"]

For anyone who gets "Expected comma" error in User Settings, put comma to previous argument and after this one "python.linting.pylintArgs": ["--load-plugins", "pylint_django"]

Must be like this:

{
    "python.pythonPath": "C:\\Program Files (x86)\\Python37-32\\python.exe",
    "python.linting.pylintEnabled": true,
    "python.linting.enabled": true,
    "[python]": {

    },
    "python.linting.pylintArgs": [
        "--load-plugins", "pylint_django"
    ],
}