-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add support for tenancy routing via custom header #145
Comments
The idea makes sense. Not so sure about providing this functionality as part of this package or rather encourage local implementation where required. Any ideas how we could make this generic enough so as to add it to pgschemas? |
This is best added in a separate, optional middleware. I check if the URL is the API endpoint and then look for the header key. If it isn't the API endpoint, i just forward it to the next middleware. The current one has to be updated to check if the tenant has already been set, if yes -> forward it; else run the std logic |
@VaZark Would you like to provide a PR adapted from your code? We could then work together on making the modifications required to integrate into this repo. |
Actually, I've got plans to implement this with a better abstraction than the current code, using some ideas from another package. Stay tuned! |
Being able to define a custom header and using it for tenancy routing would make it a straightforward experience when django is used exclusively as a api backend.
The text was updated successfully, but these errors were encountered: