[Django]-Multi-tenant-schemas:dynamic api routing using django restframework

4👍

I followed django-tenants ,and their team implemented almost everything required for django multi-tenant SaaS(Software As a Service) application. So I haven’t done much work beyond understanding architecture; I just want to answer this question.

First start with admin and their privileges; for the above requirement, I have two admin roles: tenants_admin, tenant_admin.

Here, tenants_admin (who serve the product) are able to manage tenants(individual company who buy the product); tenants_admin can manipulate data of tenants and they are located at tables in public schema.

Now coming to tenant_admin, who has privilege over data of tenant users (let’s say employees in single company).

Now clone the project from django-tenants, create app particularly for tenants. These tenant schemas are strongly isolated from each other, include both the app name and rest_framework to tenant apps. Afterwards implement REST API as usual; these API will be navigated automatically by using middleware we created for project.

👤Ramsk

Leave a comment