Home:ALL Converter>pylint django with django-configurations

pylint django with django-configurations

Ask Time:2021-02-17T23:32:15         Author:Yvain

Json Formatter

UPDATE 2021 March 29 : There is a known issue here

How to make pylint-django work together with django-configurations ?

I've setup a Django project in VS code with pylint and django-pylint as linter.

I have a conflict with django-configurations, a package that I use to have different config file depending on environment.

I specify django-settings-module in order for django-pylint to understand django project.

Settings.json in vscode looks like this :

{
// ...
"python.linting.pylintArgs": [
    "--load-plugins", "pylint_django", // Works fine
    // "--django-settings-module", "project.settings" // Do not work anymore when adding this
    ],
],
// ...
}

Also I've tried the same config file with another django project that does not use django-configurations and pylint django works well with second line on.

Author:Yvain,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/66245115/pylint-django-with-django-configurations
yy