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

howto register multiple grpc handlers from multiple apps in one django project ? #41

Open
markdoerr opened this issue Sep 12, 2022 · 1 comment

Comments

@markdoerr
Copy link

I have a django project with > 10 different apps, each having a gRPC interface.
What is the cleanest way to register all gRPC handlers in your framework ?
It would be nice, if I could use the GRPC_FRAMEWORK settings for that, but it currently has only a GRPC_ROOT_HANDLERS hook, which points to one module.

What about adding there a list of GRPC_HANDLERS ?
Example:

GRPC_FRAMEWORK = { 'GRPC_HANDLERS': ['app1.grpc_interface.handlers', 'app2.grpc_interface.handlers', ...] }
This would allow to add new handlers even with environment variables, e.g. for configuring a complex django project.

@legau
Copy link

legau commented Sep 29, 2022

Hi,
the way we usually do it is that we have one single main handler which imports the handlers of all the other apps.
However using a list directly in the settings would be a great enhancement imo

This lib is not maintained anymore, I suggest you take a look into https://github.com/socotecio/django-socio-grpc which we do maintain and post this issue there

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