Independent database architecture for each client

0

Objective. I have to develop a project with Django and I want it to have the following characteristic: for each company or client (whether company or not) that uses my system, I want a database to be created independent.

Basically what I want is for the system to have "superusers", and that the data of each of them have a database. For each superuser there will be a company and users of that company's system.

What I researched. I've found with the following options :

  • that each client has its own independent database
  • there is a common database for all clients, but each client has its own independent scheme.
  • (it's not what I want) a common database for all the clients and that the data of each one is identified with an FK in each one of the tables.
  • Question. Is it possible to use a separate database per customer with Django? How would it be done?

    Attempts. I found a package called "django multi tenant postgresql" (or something similar). It is not clear to me if this is what can be done with this package

        
    asked by Matias Alvarez 02.07.2017 в 05:47
    source

    1 answer

    0

    What you have to do is define for each model a "ForeignKey" "ManytoMany" or "OneToOne" relationship, as the case may be, to the User django.contrib.auth.models .

        
    answered by 23.07.2018 в 01:47