You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue is that creating the Settings objects already configures the settings.
See the symptom:
$ pylint --load-plugins=pylint_django --enable=W0611 --disable=bad-continuation,invalid-name,no-self-argument,E0211,C0116,C0115,C0114 --max-line-length=110 --django-settings-module=heypluto.settings.local **/*.py
************* Module Command line
Command line:1:0: R0022: Useless option value for '--disable', 'bad-continuation' was removed from pylint, see https://github.com/PyCQA/pylint/pull/3571. (useless-option-value)
Traceback (most recent call last):
File "/home/dev/.virtualenvs/pluto-chat/lib/python3.8/site-packages/pylint_django/checkers/foreign_key_strings.py", line 92, in open
django.setup()
File "/home/dev/.virtualenvs/pluto-chat/lib/python3.8/site-packages/django/__init__.py", line 19, in setup
configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
File "/home/dev/.virtualenvs/pluto-chat/lib/python3.8/site-packages/django/conf/__init__.py", line 82, in __getattr__
self._setup(name)
File "/home/dev/.virtualenvs/pluto-chat/lib/python3.8/site-packages/django/conf/__init__.py", line 63, in _setup
raise ImproperlyConfigured(
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.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/dev/.virtualenvs/pluto-chat/bin/pylint", line 8, in <module>
sys.exit(run_pylint())
File "/home/dev/.virtualenvs/pluto-chat/lib/python3.8/site-packages/pylint/__init__.py", line 25, in run_pylint
PylintRun(argv or sys.argv[1:])
File "/home/dev/.virtualenvs/pluto-chat/lib/python3.8/site-packages/pylint/lint/run.py", line 207, in __init__
linter.check(args)
File "/home/dev/.virtualenvs/pluto-chat/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 646, in check
self._check_files(
File "/home/dev/.virtualenvs/pluto-chat/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 681, in _check_files
with self._astroid_module_checker() as check_astroid_module:
File "/usr/lib/python3.8/contextlib.py", line 113, in __enter__
return next(self.gen)
File "/home/dev/.virtualenvs/pluto-chat/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 859, in _astroid_module_checker
checker.open()
File "/home/dev/.virtualenvs/pluto-chat/lib/python3.8/site-packages/pylint_django/checkers/foreign_key_strings.py", line 120, in open
settings.configure(Settings(self.config.django_settings_module))
File "/home/dev/.virtualenvs/pluto-chat/lib/python3.8/site-packages/django/conf/__init__.py", line 118, in configure
raise RuntimeError('Settings already configured.')
RuntimeError: Settings already configured.
I get a crash now when using the commandline flags.
Fix #385
The issue is that creating the Settings objects already configures the settings.
See the symptom:
Pylint version:
Relevant pip freeze:
The text was updated successfully, but these errors were encountered: