Skip to content
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

AttributeError: 'ForeignKeyStringsChecker' object has no attribute 'config' #430

Open
EfraimGENC opened this issue Mar 21, 2024 · 4 comments

Comments

@EfraimGENC
Copy link

My Requirements:

Django==5.0.3
django-environ==0.11.2
psycopg2-binary==2.9.9
redis==5.0.3
djangorestframework==3.15.0
markdown==3.6.0
django-filter==24.1
celery==5.3.6
pylint==3.1.0
pylint-django==2.5.5
django-debug-toolbar==4.3.0

When I run this command:
pylint --load-plugins pylint_django --django-settings servis.settings.dev .

I am getting this error:

...
  File "/Users/<myusername>/Documents/projects/<myproject>/venv/lib/python3.12/site-packages/pylint/lint/pylinter.py", line 946, in _astroid_module_checker
    checker.open()
  File "/Users/<myusername>/Documents/projects/<myproject>/venv/lib/python3.12/site-packages/pylint_django/checkers/foreign_key_strings.py", line 120, in open
    args=self.config.django_settings_module,
         ^^^^^^^^^^^
AttributeError: 'ForeignKeyStringsChecker' object has no attribute 'config'

I couldn't find any solution via googling with AttributeError: 'ForeignKeyStringsChecker' object has no attribute 'config'

Is anyone can help me? Do you support Django 5.0 ?

@shtalinberg
Copy link

I have the same error with Django==4.2.13 and python3.10

@shtalinberg
Copy link

@EfraimGENC I resolved by set this setting for my project
init-hook='import os, sys; sys.path.append("src"); sys.path.append("src/apps");'

carlio added a commit that referenced this issue Jul 20, 2024
@carlio
Copy link
Collaborator

carlio commented Jul 20, 2024

@EfraimGENC Can you try this now with the latest master branch? I just found a bug elsewhere which I think will fix this one too.

Regarding 5.0, that is supported in the latest master branch, I'm working towards making a release to PyPI with that support.

@ediordna
Copy link

ediordna commented Sep 4, 2024

Is it possible to release this to a new version to make it downloadable via pip etc?

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

4 participants