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

interceptor error #29

Open
KevinFan1 opened this issue Jul 21, 2021 · 3 comments
Open

interceptor error #29

KevinFan1 opened this issue Jul 21, 2021 · 3 comments

Comments

@KevinFan1
Copy link

image

my test interceptor code:

import grpc
from loguru import logger`



class ValidateInterceptor(grpc.ServerInterceptor):

    def intercept_service(self, continuation, handler_call_details):
        logger.info('this is my interceptor')
        return continuation(handler_call_details)

image

i think there is something wrong in djangogrpcframework settings while handling interceptor path, it needs the () to instantiate the class which imports from the settings with string. Could you help me take a look?

@tiennm90
Copy link

I have same issue. Any one have any idea ?

@KevinFan1
Copy link
Author

I have same issue. Any one have any idea ?

just download the libs to your project and change the origin code

@zhoujingryan
Copy link

zhoujingryan commented Feb 25, 2022

I have same issue. Any one have any idea ?

maybe this would help:

interceptor1 = SomeInterceptrorClass()

# in settings
"SERVER_INTERCEPTORS": ("path.to.interceptor1",)

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

3 participants