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

mypy complaints for custum settings: 'Settings' object has no attribute 'TESTXYZ' #2148

Open
stevenengland opened this issue Mar 26, 2023 · 1 comment

Comments

@stevenengland
Copy link

Hi at all,

if I add a custom setting to for example test-project/server/settings/components/common.py

common.py
TESTXYZ = "test"

reference it somewhere like in test-project/server/apps/main/views.py

    xyz = settings.TESTXYZ

and if I then run mypy . I get the complaint:
server/apps/main/views.py:14: error: 'Settings' object has no attribute 'TESTXYZ' [misc]

-> Is it just me hitting this error or is there a real issue?
I think this is might be because django-stubs not supporting custom vars. Am I mistaken here? If this is a general issue or even a not supported scenario: What might be a good practice to "get rid" of the mypy errors for settings?

Kind regards

@sobolevn
Copy link
Member

Will be solved by typeddjango/django-stubs#1557

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

2 participants