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

grpc_settings: get user_stettings does not seem to work properly ? #40

Open
markdoerr opened this issue Sep 12, 2022 · 0 comments
Open

Comments

@markdoerr
Copy link

I cannot access GRPC_FRAMEWORK user settings properly (might be a bug in line 97 of your setting.py module):

I specified some user settings in my django settings file:

settings.py
GRPC_FRAMEWORK = { # 'ROOT_HANDLERS_HOOK': 'handlers.grpc_handlers', 'GRPC_HANDLERS': [] }
but when I try to retrieve the user settings:
from django_grpc_framework.settings import grpc_settings print(grpc_settings.GRPC_HANDLERS)

I get the expected error:
print(grpc_settings.GRPC_HANDLERS) File "/home/mark/py3venv/lara10/lib/python3.9/site-packages/django_grpc_framework/settings.py", line 93, in __getattr__ raise AttributeError("Invalid gRPC setting: '%s'" % attr) AttributeError: Invalid gRPC setting: 'GRPC_HANDLERS'

but it will not search in the self._user_settings

I think, there is an underscore missing in line 97 of django_grpc_framework/settings.py:
It should probably read:
try: # Check if present in user settings **val = self._user_settings[attr]**

I would be happy, if you could resolve the bug soon - or update the documentation on the correct way of adding user settings.
Thanks a lot !

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