Devtech

Talk about technologies

Multi Tenant Application using Django – Connect and manage multiple databases to the single application

     Today I am going to talk about multi-tenancy. What is multi-tenancy and how to make a multi-tenant architecture based application. Multi-tenancy refers to single instance of the application which server multiple tenants. Tenants refer to the group of users who have common access with specific privileges to the software resource. Suppose that there is a simple application connected to the multiple databases, and each database belongs to the specific users or tenant. Today, I am going to show you how to make a Django Applicaion connect to the multiple database, switching the databases at run time, get data from the multiple databases and also managing the django admin of the each database site. By the database site we refer to the URL where particular database can be managed. Each database has its own corresponding URL or site, eg: testdb1 has admin uri say – http://localhost:8000/testdb1_admin/ or testdb2 has admin uri say – http://localhost:8000/testdb2_admin/. If you are only interested in the source code, it is hosted in my github account here – https://github.com/tusharcoder/multiDbApp. To set up the project:-

     In the […]

Show Buttons
Hide Buttons