#Support Request for Implementing Multi-Tenancy in Django

7 messages · Page 1 of 1 (latest)

hard thunder
#

I am currently working on a project where I need to implement a multi-tenancy architecture using Django. The goal is to have a single application that can serve multiple clients, each with its own isolated database schema.

Here are the key requirements for the project:

A central database to manage users, client information, and user-client relationships.
Each client should have its own database schema to store their specific data.
When a user logs in, they should be directed to their respective client's database.
We prefer to implement this solution using Django’s native features and best practices.
The multi-tenancy should be achieved without altering domains or subdomains; instead, we plan to use a token to direct users to their respective databases.
Could you please assist me with setting up this multi-tenancy architecture in Django? Any guidance, best practices, or example implementations would be highly appreciated.

river escarp
#

I think the fundamental description of the approach here is not a good one. A single database where data is tagged as belonging to a certain customer with a foreign key and then filtering on that is much more sane.

#

filtering can easily be done by each user having a FK to the company

night phoenix
#

Are you look for something like what is described in this youtube video: https://www.youtube.com/watch?v=uvaO85GbdzA

In this video I'll show you how get started with Django Tenants. This Django app allows you to create a separate database schema for each user. So each user will own data that doesn't get mixed in with data from other users.

Need one-on-one help with your project? I can help through my coaching program. Learn more here: https://prettyprinted.co...

▶ Play video
civic crater
river escarp
#

Again: I strongly recommend you do not do this.

echo minnow