Skip to content

Exception when there's an error in the code #311

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
christiankf opened this issue Feb 16, 2021 · 0 comments
Open

Exception when there's an error in the code #311

christiankf opened this issue Feb 16, 2021 · 0 comments

Comments

@christiankf
Copy link

When running the following command:

pylint --load-plugins=pylint_django --django-settings-module=app.settings file.py`

I get the following exception:

django.core.exceptions.ImproperlyConfigured: Requested setting LOGGING_CONFIG, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.

Along with the exception for the error in the code:

NameError: name 'timezone' is not defined

The last error is actually the one I want to see in the linter being marked but the result is that it's not linting anything at all (VSCode). When I remove the error linting works as expected. When removing the pylint-django plugin linting works as well (but obviously showing the django specific warnings I wanted to get rid of with the plugin).

I'm new to pylint-django but that can't be the expected behaviour, right? That would mean the code can't have any errors, which would be exactly what I expect the linter to find.

Maybe it's related to: #309

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant