fengsp / django-grpc-framework

gRPC for Django.
https://djangogrpcframework.readthedocs.io/
Apache License 2.0
390 stars 52 forks source link

interceptor error #29

Open KevinFan1 opened 3 years ago

KevinFan1 commented 3 years ago

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 commented 3 years ago

I have same issue. Any one have any idea ?

KevinFan1 commented 3 years ago

I have same issue. Any one have any idea ?

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

zhoujingryan commented 2 years ago

I have same issue. Any one have any idea ?

maybe this would help:

interceptor1 = SomeInterceptrorClass()

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