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

docs: What is the intended way of accessing settings? #470

Closed
stevenengland opened this issue Mar 26, 2023 · 2 comments
Closed

docs: What is the intended way of accessing settings? #470

stevenengland opened this issue Mar 26, 2023 · 2 comments

Comments

@stevenengland
Copy link

Hi at all,

could you please confirm that even when using django-split-settings the intended way to access (merged) configuration vars is still this?

from django.conf import settings

print(settings.SOME_ARBITRARY_SETTING)
#^--- prints the the actual value, setting key is accessable

It is not explicitly stated in the docs and I wonder if it is the correct way. Because every var that is not a native Django var (like SECRET_KEY) will not be recognized by mypy (and that way I think my underlying question is connected to #441):

# mypy complaint:
'Settings' object has no attribute 'SOME_ARBITRARY_SETTING'  [misc]

This key is specified in a file like in your examples:

from split_settings.tools import optional, include

include(
    'components/base.py',
    'components/arbitrary.py', # <-- here
    optional('local_settings.py')
)
@stevenengland
Copy link
Author

Because of the question concering the docs I leave this issue open. For the actual issue related in my description I opened another one that might be better targeted towards the cookiecutter template: wemake-services/wemake-django-template#2148

@sobolevn
Copy link
Member

Thanks for the report, there's nothing I can do in this repo. It is a django-stubs bug. It is known and I hope will be fixed soon.

@sobolevn sobolevn closed this as not planned Won't fix, can't repro, duplicate, stale Mar 26, 2023
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