Is it possible for Django to use the same link and a database for each client?
Hello, I'm new to Django and I have a question. I'm bringing a PHP system to Django where all clients use the same link to access the system, but each with its database with users, access groups, etc. In the custom login screen they inform their client id, user and password to authenticate, where always the client id is the name of the database.
I made the following code to change the database connection that is probably wrong:
def change_db (self):
connections ['default']. settings_dict ['NAME'] = self.db
return True
The code even exchanges the database I want to access, but testing on my local machine using the runserver, if another client is accessing simultaneously for example in another browser, it displaces the other client.
Has anyone had it or does it have an idea to solve? I searched the routers, I do not know if I would solve my problem, or if there was the same problem of switching the connection and removing the other client.
Grateful.